Fixes JS test runner and all test pass
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
angular.module('umbraco.mocks').
|
||||
factory('mocksUtils', ['$cookieStore', function($cookieStore) {
|
||||
factory('mocksUtils', ['$cookies', function ($cookies) {
|
||||
'use strict';
|
||||
|
||||
//by default we will perform authorization
|
||||
@@ -297,7 +297,7 @@ angular.module('umbraco.mocks').
|
||||
/** Checks for our mock auth cookie, if it's not there, returns false */
|
||||
checkAuth: function () {
|
||||
if (doAuth) {
|
||||
var mockAuthCookie = $cookieStore.get("mockAuthCookie");
|
||||
var mockAuthCookie = $cookies.get("mockAuthCookie");
|
||||
if (!mockAuthCookie) {
|
||||
return false;
|
||||
}
|
||||
@@ -311,12 +311,12 @@ angular.module('umbraco.mocks').
|
||||
/** Creates/sets the auth cookie with a value indicating the user is now authenticated */
|
||||
setAuth: function() {
|
||||
//set the cookie for loging
|
||||
$cookieStore.put("mockAuthCookie", "Logged in!");
|
||||
$cookies.put("mockAuthCookie", "Logged in!");
|
||||
},
|
||||
|
||||
/** removes the auth cookie */
|
||||
clearAuth: function() {
|
||||
$cookieStore.remove("mockAuthCookie");
|
||||
$cookies.remove("mockAuthCookie");
|
||||
},
|
||||
|
||||
urlRegex: function(url) {
|
||||
|
||||
@@ -5,10 +5,8 @@ var app = angular.module('umbraco', [
|
||||
'umbraco.services',
|
||||
'umbraco.mocks',
|
||||
'umbraco.interceptors',
|
||||
|
||||
'ngRoute',
|
||||
'ngCookies',
|
||||
'LocalStorageModule'
|
||||
]);
|
||||
|
||||
/* For Angular 1.2: we need to load in Routing separately
|
||||
'ngRoute'
|
||||
*/
|
||||
'LocalStorageModule'
|
||||
]);
|
||||
|
||||
@@ -12,15 +12,18 @@ module.exports = function (config) {
|
||||
|
||||
//libraries
|
||||
'lib-bower/jquery/jquery.min.js',
|
||||
'lib/angular/1.1.5/angular.js',
|
||||
'lib/angular/1.1.5/angular-cookies.min.js',
|
||||
'lib/angular/1.1.5/angular-mocks.js',
|
||||
'lib/angular/angular-ui-sortable.js',
|
||||
'lib-bower/angular/angular.js',
|
||||
'lib-bower/angular-animate/angular-animate.js',
|
||||
'lib-bower/angular-cookies/angular-cookies.js',
|
||||
'lib-bower/angular-local-storage/angular-local-storage.min.js',
|
||||
'lib-bower/angular-route/angular-route.js',
|
||||
'lib-bower/angular-sanitize/angular-sanitize.js',
|
||||
'bower_components/angular-mocks/angular-mocks.js',
|
||||
'lib-bower/angular-ui-sortable/sortable.js',
|
||||
'lib-bower/underscore/underscore-min.js',
|
||||
'lib-bower/moment/moment-with-locales.js',
|
||||
'lib/umbraco/Extensions.js',
|
||||
'lib-bower/rgrove-lazyload/lazyload.js',
|
||||
'lib-bower//angular-local-storage/angular-local-storage.min.js',
|
||||
|
||||
//app bootstrap and loader
|
||||
'test/config/app.unit.js',
|
||||
@@ -29,7 +32,7 @@ module.exports = function (config) {
|
||||
'src/common/directives/*.js',
|
||||
'src/common/filters/*.js',
|
||||
'src/common/services/*.js',
|
||||
'src/common/security/*.js',
|
||||
'src/common/interceptors/*.js',
|
||||
'src/common/resources/*.js',
|
||||
'src/views/**/*.controller.js',
|
||||
|
||||
|
||||
@@ -3,10 +3,7 @@ describe('contentEditingHelper tests', function () {
|
||||
|
||||
beforeEach(module('umbraco.services'));
|
||||
beforeEach(module('umbraco.mocks'));
|
||||
|
||||
|
||||
//Only for 1.2: beforeEach(module('ngRoute'));
|
||||
|
||||
beforeEach(module('ngRoute'));
|
||||
|
||||
beforeEach(inject(function ($injector, localizationMocks) {
|
||||
localizationMocks.register();
|
||||
@@ -236,4 +233,4 @@ describe('contentEditingHelper tests', function () {
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user