0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🐛 Fixed archiving Tiers (#15761)

refs https://github.com/TryGhost/Team/issues/2204

The TiersAPI was incorrectly using the `active` property rather than
`status` property when editing Tiers.
This commit is contained in:
Fabien 'egg' O'Carroll 2022-11-03 16:51:19 +07:00 committed by Fabien "egg" O'Carroll
parent 13c6204197
commit c923607bb9
2 changed files with 19 additions and 3 deletions

View file

@ -105,7 +105,7 @@ module.exports = class TiersAPI {
'benefits',
'description',
'visibility',
'active',
'status',
'trialDays',
'welcomePageURL'
];

View file

@ -66,11 +66,27 @@ describe('TiersAPI', function () {
assert(updated.name === 'Updated');
});
it('Can archive a tier', async function () {
const tier = await api.add({
name: 'My testing Tier',
type: 'paid',
monthlyPrice: 5000,
yearlyPrice: 50000,
currency: 'usd'
});
const updated = await api.edit(tier.id.toHexString(), {
status: 'archived'
});
assert(updated.status === 'archived');
});
it('Can browse tiers', async function () {
const page = await api.browse();
assert(page.data.length === 2);
assert(page.meta.pagination.total === 2);
assert(page.data.length === 3);
assert(page.meta.pagination.total === 3);
});
it('Can read a default tier', async function () {