Deselect food, egg, and potion when hitting the escape key

This commit is contained in:
TheHollidayInn
2015-07-21 21:52:29 -05:00
parent 11f56d491c
commit 107e27a2c6
3 changed files with 44 additions and 1 deletions

View File

@@ -89,4 +89,27 @@ describe('Inventory Controller', function() {
expect(user.balance).to.eql(3.25);
expect(user.items.eggs).to.eql({Cactus: 1, Wolf: 1})
}));
describe('Deselecting Items', function() {
it('deselects a food', function(){
scope.chooseFood('Meat');
scope.deselectItem();
expect(scope.selectedFood).to.eql(null);
});
it('deselects a potion', function(){
scope.choosePotion('Base');
scope.deselectItem();
expect(scope.selectedPotion).to.eql(null);
});
it('deselects a egg', function(){
scope.chooseEgg('Cactus');
scope.deselectItem();
expect(scope.selectedEgg).to.eql(null);
});
});
});