Fix broken Angular app test setup

This commit is contained in:
arknu
2014-10-04 23:37:46 +02:00
parent 0ce83630d7
commit 95c4fb740a
5 changed files with 66 additions and 4 deletions

View File

@@ -8,7 +8,8 @@ var app = angular.module('umbraco', [
'ngMobile',
'ngSanitize',
/*'ui.sortable',*/
'blueimp.fileupload'
'blueimp.fileupload',
'tmh.dynamicLocale'
]);
/* For Angular 1.2: we need to load in Route, animate and touch seperately

View File

@@ -11,11 +11,71 @@ angular.module('umbraco.mocks').
}
}
function getCanvasEditorConfiguration(status, data, headers){
if (!mocksUtils.checkAuth()) {
return [401, null, null];
}
else {
return [200,
[
{
"name": "Rich text editor",
"alias": "rte",
"view": "rte",
"icon": "icon-article"
},
{
"name": "Image",
"alias": "media",
"view": "media",
"icon": "icon-picture"
},
{
"name": "Macro",
"alias": "macro",
"view": "macro",
"icon": "icon-settings-alt"
},
{
"name": "Embed",
"alias": "embed",
"view": "embed",
"icon": "icon-movie-alt"
},
{
"name": "Headline",
"alias": "headline",
"view": "textstring",
"icon": "icon-coin",
"config": {
"style": "font-size: 36px; line-height: 45px; font-weight: bold",
"markup": "<h1>#value#</h1>"
}
},
{
"name": "Quote",
"alias": "quote",
"view": "textstring",
"icon": "icon-quote",
"config": {
"style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-variant: italic; font-size: 18px",
"markup": "<blockquote>#value#</blockquote>"
}
}
], null];
}
}
return {
register: function() {
$httpBackend
.whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/RichTextPreValue/GetConfiguration'))
.respond(getRichTextConfiguration);
$httpBackend
.whenGET(mocksUtils.urlRegex('../config/canvas.editors.config.js'))
.respond(getCanvasEditorConfiguration);
}
};
}]);

View File

@@ -124,7 +124,7 @@ angular.module('umbraco.mocks').
label: "Grid",
id: 8,
properties: [
{ alias: "grid", label: "Grid", view: "grid", value: "test", hideLabel: true }
{ alias: "canvas", label: "Grid", view: "canvas", value: "test", hideLabel: true }
]
}, {
label: "Generic Properties",

View File

@@ -10,7 +10,8 @@ angular.module('umbraco.mocks').
emailHash: "f9879d71855b5ff21e4963273a886bfc",
id: 0,
locale: 'da-DK',
remainingAuthSeconds: 600
remainingAuthSeconds: 600,
allowedSections: ["content", "media"]
};
}

View File

@@ -1,4 +1,4 @@
angular.module('Umbraco.mocks').
angular.module('umbraco.mocks').
factory('localizationMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) {
'use strict';