Fix auth if localStorage is missing or corrupted (#7674)
* fix(auth): correctly redirect to logout page if localstorage is corrupted * fix(auth): do not break site if localStorage has invalid JSON * fix(karma): use $window instead of windo * disable failing karma tests * fix(tests): Provide mockwindow for tests * fix(tests): Call habitrpgShared without $window
This commit is contained in:
@@ -4,7 +4,11 @@ describe("CopyMessageModal controller", function() {
|
||||
var scope, ctrl, user, Notification, $rootScope, $controller;
|
||||
|
||||
beforeEach(function() {
|
||||
module(function($provide) {});
|
||||
module(function($provide) {
|
||||
var mockWindow = {href: '', alert: sandbox.spy(), location: {search: '', pathname: '', href: ''}};
|
||||
|
||||
$provide.value('$window', mockWindow);
|
||||
});
|
||||
|
||||
inject(function($rootScope, _$controller_, _Notification_, User){
|
||||
user = specHelper.newUser();
|
||||
|
||||
Reference in New Issue
Block a user