mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
@@ -8,6 +8,7 @@ describe('Auth Controller', function() {
|
||||
beforeEach(function(){
|
||||
module(function($provide) {
|
||||
$provide.value('Analytics', analyticsMock);
|
||||
$provide.value('Chat', { seenMessage: function() {} });
|
||||
});
|
||||
|
||||
inject(function(_$httpBackend_, $rootScope, $controller) {
|
||||
@@ -22,6 +23,8 @@ describe('Auth Controller', function() {
|
||||
})
|
||||
});
|
||||
|
||||
describe('logging in', function() {
|
||||
|
||||
it('should log in users with correct uname / pass', function() {
|
||||
$httpBackend.expectPOST('/api/v2/user/auth/local').respond({id: 'abc', token: 'abc'});
|
||||
scope.auth();
|
||||
@@ -39,4 +42,10 @@ describe('Auth Controller', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('clearMessage', function() {
|
||||
it('is Chat.seenMessage', inject(function(Chat) {
|
||||
expect(scope.clearMessages).to.eql(Chat.seenMessage);
|
||||
}));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
*/
|
||||
|
||||
angular.module('habitrpg')
|
||||
.controller("AuthCtrl", ['$scope', '$rootScope', 'User', '$http', '$location', '$window','ApiUrl', '$modal', 'Analytics',
|
||||
function($scope, $rootScope, User, $http, $location, $window, ApiUrl, $modal, Analytics) {
|
||||
.controller("AuthCtrl", ['$scope', '$rootScope', 'User', '$http', '$location', '$window','ApiUrl', '$modal', 'Analytics', 'Chat',
|
||||
function($scope, $rootScope, User, $http, $location, $window, ApiUrl, $modal, Analytics, Chat) {
|
||||
$scope.Analytics = Analytics;
|
||||
|
||||
$scope.logout = function() {
|
||||
@@ -102,6 +102,7 @@ angular.module('habitrpg')
|
||||
}
|
||||
};
|
||||
|
||||
// @TODO: Pull out menu stuff into separate menu controller
|
||||
$scope.expandMenu = function(menu) {
|
||||
$scope._expandedMenu = ($scope._expandedMenu == menu) ? null : menu;
|
||||
};
|
||||
@@ -121,6 +122,8 @@ angular.module('habitrpg')
|
||||
}
|
||||
};
|
||||
|
||||
$scope.clearMessages = Chat.seenMessage;
|
||||
|
||||
$scope.iconClasses = function() {
|
||||
return selectNotificationValue(
|
||||
"glyphicon-gift",
|
||||
|
||||
@@ -200,7 +200,7 @@ nav.toolbar(ng-controller='AuthCtrl', ng-class='{active: isToolbarHidden}')
|
||||
a(ng-click='k==party._id ? $state.go("options.social.party") : $state.go("options.social.guilds.detail",{gid:k}); expandMenu(null)')
|
||||
span.glyphicon.glyphicon-comment
|
||||
span {{v.name}}
|
||||
a(ng-click='Groups.seenMessage(k)', popover=env.t('clear'),popover-placement='right',popover-trigger='mouseenter',popover-append-to-body='true')
|
||||
a(ng-click='clearMessages(k)', popover=env.t('clear'),popover-placement='right',popover-trigger='mouseenter',popover-append-to-body='true')
|
||||
span.glyphicon.glyphicon-remove-circle
|
||||
// li(ng-if='user.items.special.valentineReceived[0] || user.items.special.nyeReceived[0]')
|
||||
a(ng-click='$state.go("options.inventory.drops"); expandMenu(null)')
|
||||
|
||||
Reference in New Issue
Block a user