mirror of
https://github.com/HabitRPG/habitica.git
synced 2026-04-19 19:21:51 -05:00
test(bundles): check balance deduction
This commit is contained in:
@@ -204,9 +204,10 @@ describe('shared.ops.purchase', () => {
|
||||
});
|
||||
|
||||
it('purchases quest bundles', () => {
|
||||
let clock = sandbox.useFakeTimers(+moment('2017-05-20'));
|
||||
let clock = sandbox.useFakeTimers(moment('2017-05-20').valueOf());
|
||||
let type = 'bundles';
|
||||
let key = 'featheredFriends';
|
||||
let price = 1.75;
|
||||
let questList = [
|
||||
'falcon',
|
||||
'harpy',
|
||||
@@ -219,6 +220,8 @@ describe('shared.ops.purchase', () => {
|
||||
expect(user.items.quests[bundledKey]).to.equal(1);
|
||||
});
|
||||
|
||||
expect(user.balance).to.equal(userGemAmount - price);
|
||||
|
||||
clock.restore();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user