From f0ddbae775ab4f5d84cee70e9a15c915f23b3436 Mon Sep 17 00:00:00 2001 From: hairlessbear Date: Mon, 22 Jun 2015 21:33:38 -0400 Subject: [PATCH] Added quest completion modal test for when RSVPNeeded is true; modified quest invite test to use 'to.not.be.calledWith' --- test/spec/controllers/notificationCtrlSpec.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/spec/controllers/notificationCtrlSpec.js b/test/spec/controllers/notificationCtrlSpec.js index 02e5c14c20..03b3e63d7f 100644 --- a/test/spec/controllers/notificationCtrlSpec.js +++ b/test/spec/controllers/notificationCtrlSpec.js @@ -50,9 +50,7 @@ describe('Notification Controller', function() { user.party.quest.completed = "hedgebeast"; scope.$digest(); - // 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'}); + expect(rootScope.openModal).to.not.be.calledWith('questInvitation', {controller:'PartyCtrl'}); }); }); @@ -69,6 +67,15 @@ describe('Notification Controller', function() { expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'}); }); + it('opens quest completion modal if RSVPNeeded is true', function() { + user.party.quest.RSVPNeeded = true; + 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();