mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
refactor(test): Give user mystery items
...instead of stubbing out timeTravelerStore
This commit is contained in:
@@ -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);
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user