mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Changed 'invite modal does not open' tests to focus on completion modal opening, but being the only modal to open. Also modified the named of two tests to be more intuitive and accurate
This commit is contained in:
@@ -42,23 +42,29 @@ describe('Notification Controller', function() {
|
|||||||
user.party.quest.completed = "hedgebeast";
|
user.party.quest.completed = "hedgebeast";
|
||||||
scope.$digest();
|
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.RSVPNeeded = true;
|
||||||
user.party.quest.completed = "hedgebeast";
|
user.party.quest.completed = "hedgebeast";
|
||||||
scope.$digest();
|
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.RSVPNeeded = true;
|
||||||
user.party.quest.completed = "hedgebeast";
|
user.party.quest.completed = "hedgebeast";
|
||||||
scope.$digest();
|
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'});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user