mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-14 19:47:03 +00:00
refactor(test): Give user mystery items
...instead of stubbing out timeTravelerStore
This commit is contained in:
parent
9be0990217
commit
f8db8f597a
1 changed files with 11 additions and 3 deletions
|
|
@ -223,13 +223,17 @@ describe('Inventory Controller', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('#hasAllTimeTravelerItems', function() {
|
||||
describe.only('#hasAllTimeTravelerItems', function() {
|
||||
it('returns false if items remain for purchase with Mystic Hourglasses', function() {
|
||||
expect(scope.hasAllTimeTravelerItems()).to.eql(false);
|
||||
});
|
||||
|
||||
it('returns true if there are no items left to purchase', inject(function(Content) {
|
||||
sandbox.stub(Content, 'timeTravelerStore').returns({});
|
||||
for (var item in Content.gear.flat) {
|
||||
if (item.indexOf('mystery') > -1) {
|
||||
user.items.gear.owned[item] = true;
|
||||
}
|
||||
}
|
||||
for (var pet in Content.timeTravelStable.pets) {
|
||||
user.items.pets[pet] = 5;
|
||||
}
|
||||
|
|
@ -247,7 +251,11 @@ describe('Inventory Controller', function() {
|
|||
});
|
||||
|
||||
it('returns true for Mystery Sets if there are no sets left to purchase', inject(function(Content) {
|
||||
sandbox.stub(Content, 'timeTravelerStore').returns({});
|
||||
for (var item in Content.gear.flat) {
|
||||
if (item.indexOf('mystery') > -1) {
|
||||
user.items.gear.owned[item] = true;
|
||||
}
|
||||
}
|
||||
|
||||
expect(scope.hasAllTimeTravelerItemsOfType('mystery')).to.eql(true);
|
||||
}));
|
||||
|
|
|
|||
Loading…
Reference in a new issue