mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
test(quests): Fix tests
This commit is contained in:
@@ -484,7 +484,8 @@ describe 'User', ->
|
||||
|
||||
describe 'Enchanted Armoire', ->
|
||||
user = newUser()
|
||||
fullArmoire = {'weapon_warrior_0': true,
|
||||
fullArmoire =
|
||||
'weapon_warrior_0': true,
|
||||
'armor_armoire_gladiatorArmor':true,
|
||||
'armor_armoire_lunarArmor':true,
|
||||
'armor_armoire_rancherRobes':true,
|
||||
@@ -499,7 +500,6 @@ describe 'User', ->
|
||||
'weapon_armoire_basicCrossbow':true,
|
||||
'weapon_armoire_lunarSceptre':true,
|
||||
'weapon_armoire_rancherLasso':true
|
||||
}
|
||||
|
||||
beforeEach ->
|
||||
# too many predictableRandom calls to stub, let's return the last element
|
||||
|
||||
@@ -24,26 +24,26 @@ describe('Quests Service', function() {
|
||||
it('locks quest when user does not meet level requirement', function() {
|
||||
user.stats.lvl = 15;
|
||||
|
||||
expect(questsService.lockQuest(quest)).to.be(true);
|
||||
expect(questsService.lockQuest(quest)).to.be.ok;
|
||||
});
|
||||
|
||||
it('does not lock quest if we ignore level requirement', function() {
|
||||
user.stats.lvl = 15;
|
||||
|
||||
expect(questsService.lockQuest(quest,true)).to.be(false);
|
||||
expect(questsService.lockQuest(quest,true)).to.not.be.ok;
|
||||
});
|
||||
|
||||
it('does not lock quest if user meets level requirement', function() {
|
||||
user.stats.lvl = 20;
|
||||
|
||||
expect(questsService.lockQuest(quest)).to.be(false);
|
||||
expect(questsService.lockQuest(quest)).to.not.be.ok;
|
||||
});
|
||||
|
||||
it('locks quest if user has not completed previous quest in series', function() {
|
||||
quest.previous = 'priorQuest';
|
||||
user.stats.lvl = 25;
|
||||
|
||||
expect(questsService.lockQuest(quest)).to.be(true);
|
||||
expect(questsService.lockQuest(quest)).to.be.ok;
|
||||
});
|
||||
|
||||
it('does not lock quest if user has completed previous quest in series', function() {
|
||||
@@ -51,7 +51,7 @@ describe('Quests Service', function() {
|
||||
user.stats.lvl = 25;
|
||||
user.achievements.quests.priorQuest = 1;
|
||||
|
||||
expect(questsService.lockQuest(quest)).to.be(false);
|
||||
expect(questsService.lockQuest(quest)).to.not.be.ok;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ var specHelper = {};
|
||||
food: {},
|
||||
pets: {},
|
||||
mounts: {},
|
||||
gear: {equipped: {}, costume: {}, owned: {}},
|
||||
gear: {equipped: {}, costume: {}, owned: {}}
|
||||
},
|
||||
party: {
|
||||
quest: {
|
||||
@@ -37,7 +37,7 @@ var specHelper = {};
|
||||
rewards: [],
|
||||
flags: {},
|
||||
filters: {},
|
||||
achievements: {},
|
||||
achievements: {}
|
||||
};
|
||||
return user;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user