Ghost/test/e2e-api/content/tiers.test.js
Fabien 'egg' O'Carroll d9e6dfe97e
Updated Tiers API data structure (#14795)
refs https://github.com/TryGhost/Team/issues/1575

- Updates the admin-api-schema to reflect new data structure
- Updates members-api to allow Portal to use new data structure
- Data is only mapped at the serialised level to avoid changing the underlying implementation
- Ensure only one version of domain-events present in yarn.lock
2022-05-16 19:47:18 +01:00

27 lines
882 B
JavaScript

const {agentProvider, fixtureManager, matchers} = require('../../utils/e2e-framework');
describe('Tiers Content API', function () {
let agent;
before(async function () {
agent = await agentProvider.getContentAPIAgent();
await fixtureManager.init('members', 'api_keys', 'tiers:archived');
agent.authenticate();
});
it('Can request only active tiers', async function () {
await agent.get('/tiers/?include=monthly_price,yearly_price,benefits')
.expectStatus(200)
.matchHeaderSnapshot({
etag: matchers.anyEtag
})
.matchBodySnapshot({
tiers: Array(2).fill({
id: matchers.anyObjectId,
created_at: matchers.anyISODate,
updated_at: matchers.anyISODate
})
});
});
});