mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-19 04:14:40 +00:00
Add failing spec for armoire edge case
This commit is contained in:
parent
83089720c8
commit
951d5417bc
1 changed files with 30 additions and 0 deletions
30
test/common/user.fns.js
Normal file
30
test/common/user.fns.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
var shared = require('../../common/script/index.coffee');
|
||||
shared.i18n.translations = require('../../website/src/i18n.js').translations
|
||||
|
||||
require('./test_helper');
|
||||
|
||||
describe('User.fns', function() {
|
||||
describe('.ultimateGear', function() {
|
||||
|
||||
it('sets armoirEnabled when partial achievement already achieved', function() {
|
||||
var user = shared.wrap({
|
||||
items: { gear: { owned: {
|
||||
toObject: function() { return {
|
||||
armor_warrior_5: true,
|
||||
shield_warrior_5: true,
|
||||
head_warrior_5: true,
|
||||
weapon_warrior_6: true
|
||||
}}
|
||||
}}},
|
||||
achievements: {
|
||||
ultimateGearSets: {}
|
||||
},
|
||||
flags: {}
|
||||
});
|
||||
user.fns.ultimateGear();
|
||||
expect(user.flags.armoireEnabled).to.equal(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue