mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Hourglass Quest (#11325)
* feat(content): Hourglass Quest * fix(hourglasses): NaN from undefined * fix(quests): sanity check for negative scrolls * fix(hourglasses): don't show quantity selection for binary items * fix(route): validate number, use body not params * test(timetrav): add quest tests
This commit is contained in:
@@ -14,7 +14,7 @@ describe('POST /user/purchase-hourglass/:type/:key', () => {
|
||||
|
||||
// More tests in common code unit tests
|
||||
|
||||
it('buys a hourglass pet', async () => {
|
||||
it('buys an hourglass pet', async () => {
|
||||
let response = await user.post('/user/purchase-hourglass/pets/MantisShrimp-Base');
|
||||
await user.sync();
|
||||
|
||||
@@ -22,4 +22,22 @@ describe('POST /user/purchase-hourglass/:type/:key', () => {
|
||||
expect(user.purchased.plan.consecutive.trinkets).to.eql(1);
|
||||
expect(user.items.pets['MantisShrimp-Base']).to.eql(5);
|
||||
});
|
||||
|
||||
it('buys an hourglass quest', async () => {
|
||||
let response = await user.post('/user/purchase-hourglass/quests/robot');
|
||||
await user.sync();
|
||||
|
||||
expect(response.message).to.eql(t('hourglassPurchase'));
|
||||
expect(user.purchased.plan.consecutive.trinkets).to.eql(1);
|
||||
expect(user.items.quests.robot).to.eql(1);
|
||||
});
|
||||
|
||||
it('buys multiple hourglass quests', async () => {
|
||||
let response = await user.post('/user/purchase-hourglass/quests/robot', {quantity: 2});
|
||||
await user.sync();
|
||||
|
||||
expect(response.message).to.eql(t('hourglassPurchase'));
|
||||
expect(user.purchased.plan.consecutive.trinkets).to.eql(0);
|
||||
expect(user.items.quests.robot).to.eql(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user