mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-22 05:44:16 +00:00
Added quest completion modal watch tests
This commit is contained in:
parent
c5292e7ff8
commit
8026e99219
1 changed files with 20 additions and 0 deletions
|
|
@ -67,4 +67,24 @@ describe('Notification Controller', function() {
|
|||
expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'});
|
||||
});
|
||||
});
|
||||
describe('Quest Completion modal watch', function() {
|
||||
beforeEach(function() {
|
||||
sandbox.stub(rootScope, 'openModal');
|
||||
});
|
||||
|
||||
it('opens quest completion modal', function() {
|
||||
user.party.quest.completed = "hedgebeast";
|
||||
scope.$digest();
|
||||
|
||||
expect(rootScope.openModal).to.be.calledOnce;
|
||||
expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'});
|
||||
});
|
||||
|
||||
it('does not open quest completion modal if quest.completed is null', function() {
|
||||
user.party.quest.completed = null;
|
||||
scope.$digest();
|
||||
|
||||
expect(rootScope.openModal).to.not.be.called;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue