diff --git a/test/spec/controllers/notificationCtrlSpec.js b/test/spec/controllers/notificationCtrlSpec.js index 1f0ceff107..5d7edc50c7 100644 --- a/test/spec/controllers/notificationCtrlSpec.js +++ b/test/spec/controllers/notificationCtrlSpec.js @@ -42,23 +42,29 @@ describe('Notification Controller', function() { user.party.quest.completed = "hedgebeast"; scope.$digest(); - expect(rootScope.openModal).to.not.be.called; + // Completion modal should open, but should be the only modal that opens + expect(rootScope.openModal).to.be.calledOnce; + expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'}); }); - it('does not open quest invitation modal if quest completed is set to false', function() { + it('does not open quest invitation modal if quest.completed contains a quest key', function() { user.party.quest.RSVPNeeded = true; user.party.quest.completed = "hedgebeast"; scope.$digest(); - expect(rootScope.openModal).to.not.be.called; + // Completion modal should open, but should be the only modal that opens + expect(rootScope.openModal).to.be.calledOnce; + expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'}); }); - it('does not open quest invitation modal if quest completed is set to true', function() { + it('does not open quest invitation modal if quest.completed contains a quest key', function() { user.party.quest.RSVPNeeded = true; user.party.quest.completed = "hedgebeast"; scope.$digest(); - expect(rootScope.openModal).to.not.be.called; + // Completion modal should open, but should be the only modal that opens + expect(rootScope.openModal).to.be.calledOnce; + expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'}); }); }); });