mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Added quest completion modal test for when RSVPNeeded is true; modified quest invite test to use 'to.not.be.calledWith'
This commit is contained in:
@@ -50,9 +50,7 @@ describe('Notification Controller', function() {
|
|||||||
user.party.quest.completed = "hedgebeast";
|
user.party.quest.completed = "hedgebeast";
|
||||||
scope.$digest();
|
scope.$digest();
|
||||||
|
|
||||||
// Completion modal should open, but should be the only modal that opens
|
expect(rootScope.openModal).to.not.be.calledWith('questInvitation', {controller:'PartyCtrl'});
|
||||||
expect(rootScope.openModal).to.be.calledOnce;
|
|
||||||
expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -69,6 +67,15 @@ describe('Notification Controller', function() {
|
|||||||
expect(rootScope.openModal).to.be.calledWith('questCompleted', {controller:'InventoryCtrl'});
|
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() {
|
it('does not open quest completion modal if quest.completed is null', function() {
|
||||||
user.party.quest.completed = null;
|
user.party.quest.completed = null;
|
||||||
scope.$digest();
|
scope.$digest();
|
||||||
|
|||||||
Reference in New Issue
Block a user