mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
@@ -39,7 +39,7 @@ describe('Notification Controller', function() {
|
|||||||
|
|
||||||
it('does not open quest invitation modal if RSVPNeeded is not true', function() {
|
it('does not open quest invitation modal if RSVPNeeded is not true', function() {
|
||||||
user.party.quest.RSVPNeeded = false;
|
user.party.quest.RSVPNeeded = false;
|
||||||
user.party.quest.completed = false;
|
user.party.quest.completed = "hedgebeast";
|
||||||
scope.$digest();
|
scope.$digest();
|
||||||
|
|
||||||
expect(rootScope.openModal).to.not.be.called;
|
expect(rootScope.openModal).to.not.be.called;
|
||||||
@@ -47,7 +47,7 @@ describe('Notification Controller', function() {
|
|||||||
|
|
||||||
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 is set to false', function() {
|
||||||
user.party.quest.RSVPNeeded = true;
|
user.party.quest.RSVPNeeded = true;
|
||||||
user.party.quest.completed = false;
|
user.party.quest.completed = "hedgebeast";
|
||||||
scope.$digest();
|
scope.$digest();
|
||||||
|
|
||||||
expect(rootScope.openModal).to.not.be.called;
|
expect(rootScope.openModal).to.not.be.called;
|
||||||
@@ -55,7 +55,7 @@ describe('Notification Controller', function() {
|
|||||||
|
|
||||||
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 is set to true', function() {
|
||||||
user.party.quest.RSVPNeeded = true;
|
user.party.quest.RSVPNeeded = true;
|
||||||
user.party.quest.completed = true;
|
user.party.quest.completed = "hedgebeast";
|
||||||
scope.$digest();
|
scope.$digest();
|
||||||
|
|
||||||
expect(rootScope.openModal).to.not.be.called;
|
expect(rootScope.openModal).to.not.be.called;
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ habitrpg.controller('NotificationCtrl',
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Quest invitation modal
|
// Quest invitation modal
|
||||||
$scope.$watch('user.party.quest.RSVPNeeded && (user.party.quest.completed !== false && user.party.quest.completed !== true)', function(after, before){
|
$scope.$watch('user.party.quest.RSVPNeeded && !user.party.quest.completed', function(after, before){
|
||||||
if (after != true) return;
|
if (after != true) return;
|
||||||
$rootScope.openModal('questInvitation', {controller:'PartyCtrl'});
|
$rootScope.openModal('questInvitation', {controller:'PartyCtrl'});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user