mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added new created tier e2e test
ref https://github.com/TryGhost/Team/issues/1446 - Added e2e test to check if a new tier can be added successfully.
This commit is contained in:
parent
e01d8a6f1d
commit
dc98868961
2 changed files with 44 additions and 0 deletions
|
@ -48,6 +48,30 @@ Object {
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`Tiers API Can create a new tier 1: [body] 1`] = `
|
||||||
|
Object {
|
||||||
|
"tiers": Array [
|
||||||
|
Object {
|
||||||
|
"active": true,
|
||||||
|
"benefits": Array [],
|
||||||
|
"created_at": "2023-03-02T08:10:21.752Z",
|
||||||
|
"currency": "USD",
|
||||||
|
"description": null,
|
||||||
|
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||||
|
"monthly_price": 100,
|
||||||
|
"name": "new tier",
|
||||||
|
"slug": "new-tier",
|
||||||
|
"trial_days": 0,
|
||||||
|
"type": "paid",
|
||||||
|
"updated_at": null,
|
||||||
|
"visibility": "public",
|
||||||
|
"welcome_page_url": null,
|
||||||
|
"yearly_price": 5000,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`Tiers API Can edit tier properties and relations 1: [body] 1`] = `
|
exports[`Tiers API Can edit tier properties and relations 1: [body] 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"meta": Object {
|
"meta": Object {
|
||||||
|
|
|
@ -166,4 +166,24 @@ describe('Tiers API', function () {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('Can create a new tier', async function () {
|
||||||
|
const tier = {
|
||||||
|
name: 'new tier',
|
||||||
|
monthly_price: 100,
|
||||||
|
currency: 'usd'
|
||||||
|
};
|
||||||
|
|
||||||
|
await agent
|
||||||
|
.post('/tiers/')
|
||||||
|
.body({tiers: [tier]})
|
||||||
|
.expectStatus(201)
|
||||||
|
.matchBodySnapshot({
|
||||||
|
tiers: Array(1).fill({
|
||||||
|
id: matchers.anyObjectId,
|
||||||
|
name: 'new tier',
|
||||||
|
monthly_price: 100,
|
||||||
|
currency: 'USD'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue