diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/tiers.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/tiers.test.js.snap index ae9a9a1efb..bc41ef16d4 100644 --- a/ghost/core/test/e2e-api/admin/__snapshots__/tiers.test.js.snap +++ b/ghost/core/test/e2e-api/admin/__snapshots__/tiers.test.js.snap @@ -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`] = ` Object { "meta": Object { diff --git a/ghost/core/test/e2e-api/admin/tiers.test.js b/ghost/core/test/e2e-api/admin/tiers.test.js index 5a4a523ca6..4f2aa8f373 100644 --- a/ghost/core/test/e2e-api/admin/tiers.test.js +++ b/ghost/core/test/e2e-api/admin/tiers.test.js @@ -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' + }) + }); + }); });