Merge branch 'dev-v7.7' into temp-U4-10401
This commit is contained in:
@@ -36,11 +36,11 @@
|
||||
"gulp-watch": "^4.3.10",
|
||||
"gulp-wrap": "^0.13.0",
|
||||
"gulp-wrap-js": "^0.4.1",
|
||||
"jasmine-core": "^2.5.2",
|
||||
"jasmine-core": "2.5.2",
|
||||
"karma": "^1.7.0",
|
||||
"karma-jasmine": "^1.1.0",
|
||||
"karma-phantomjs-launcher": "^1.0.4",
|
||||
"less": "^2.6.1",
|
||||
"less": "^2.6.1",
|
||||
"lodash": "^4.16.3",
|
||||
"merge-stream": "^1.0.1",
|
||||
"run-sequence": "^2.1.0"
|
||||
|
||||
@@ -150,9 +150,7 @@ function formHelper(angularHelper, serverValidationManager, $timeout, notificati
|
||||
dialogService.ysodDialog(err);
|
||||
}
|
||||
}
|
||||
else {
|
||||
dialogService.ysodDialog(err);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = function(config) {
|
||||
module.exports = function (config) {
|
||||
|
||||
config.set({
|
||||
config.set({
|
||||
|
||||
// base path, that will be used to resolve files and exclude
|
||||
basePath: '../..',
|
||||
@@ -10,32 +10,35 @@ module.exports = function(config) {
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
|
||||
//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/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',
|
||||
//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/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',
|
||||
//app bootstrap and loader
|
||||
'test/config/app.unit.js',
|
||||
|
||||
//application files
|
||||
'src/common/directives/**/*.js',
|
||||
'src/common/filters/*.js',
|
||||
'src/common/services/*.js',
|
||||
'src/common/security/*.js',
|
||||
'src/common/resources/*.js',
|
||||
'src/common/mocks/**/*.js',
|
||||
'src/views/**/*.controller.js',
|
||||
//application files
|
||||
'src/common/directives/*.js',
|
||||
'src/common/filters/*.js',
|
||||
'src/common/services/*.js',
|
||||
'src/common/security/*.js',
|
||||
'src/common/resources/*.js',
|
||||
'src/views/**/*.controller.js',
|
||||
|
||||
//tests
|
||||
'test/unit/**/*.spec.js'
|
||||
//mocked data and routing
|
||||
'src/common/mocks/umbraco.servervariables.js',
|
||||
'src/common/mocks/**/*.js',
|
||||
|
||||
//tests
|
||||
'test/unit/**/*.spec.js'
|
||||
],
|
||||
|
||||
// list of files to exclude
|
||||
@@ -78,9 +81,10 @@ module.exports = function(config) {
|
||||
// CLI --browsers Chrome,Firefox,Safari
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
// If browser does not capture in given timeout [ms], kill it
|
||||
// CLI --capture-timeout 5000
|
||||
captureTimeout: 5000,
|
||||
// allow waiting a bit longer, some machines require this
|
||||
|
||||
browserNoActivityTimeout: 100000, // default 10,000ms
|
||||
|
||||
|
||||
// Auto run tests on start (when browsers are captured) and exit
|
||||
// CLI --single-run --no-single-run
|
||||
@@ -89,7 +93,7 @@ module.exports = function(config) {
|
||||
// report which specs are slower than 500ms
|
||||
// CLI --report-slower-than 500
|
||||
reportSlowerThan: 500,
|
||||
|
||||
|
||||
plugins: [
|
||||
'karma-jasmine',
|
||||
'karma-phantomjs-launcher'
|
||||
|
||||
@@ -2,93 +2,93 @@
|
||||
// The current setup will have problems with loading the HTML etc.
|
||||
// These tests are therefore ignored for now.
|
||||
|
||||
describe('edit content controller tests', function () {
|
||||
var scope, controller, routeParams, httpBackend, wasSaved, q;
|
||||
routeParams = {id: 1234, create: false};
|
||||
// describe('edit content controller tests', function () {
|
||||
// var scope, controller, routeParams, httpBackend, wasSaved, q;
|
||||
// routeParams = {id: 1234, create: false};
|
||||
|
||||
beforeEach(module('umbraco'));
|
||||
// beforeEach(module('umbraco'));
|
||||
|
||||
//inject the contentMocks service
|
||||
beforeEach(inject(function ($rootScope, $q, $controller, $compile, angularHelper, $httpBackend, contentMocks, entityMocks, mocksUtils, localizationMocks) {
|
||||
q = $q;
|
||||
//for these tests we don't want any authorization to occur
|
||||
mocksUtils.disableAuth();
|
||||
// //inject the contentMocks service
|
||||
// beforeEach(inject(function ($rootScope, $q, $controller, $compile, angularHelper, $httpBackend, contentMocks, entityMocks, mocksUtils, localizationMocks) {
|
||||
// q = $q;
|
||||
// //for these tests we don't want any authorization to occur
|
||||
// mocksUtils.disableAuth();
|
||||
|
||||
httpBackend = $httpBackend;
|
||||
scope = $rootScope.$new();
|
||||
// httpBackend = $httpBackend;
|
||||
// scope = $rootScope.$new();
|
||||
|
||||
//have the contentMocks register its expect urls on the httpbackend
|
||||
//see /mocks/content.mocks.js for how its setup
|
||||
contentMocks.register();
|
||||
entityMocks.register();
|
||||
localizationMocks.register();
|
||||
// //have the contentMocks register its expect urls on the httpbackend
|
||||
// //see /mocks/content.mocks.js for how its setup
|
||||
// contentMocks.register();
|
||||
// entityMocks.register();
|
||||
// localizationMocks.register();
|
||||
|
||||
//this controller requires an angular form controller applied to it
|
||||
scope.contentForm = angularHelper.getNullForm("contentForm");
|
||||
// //this controller requires an angular form controller applied to it
|
||||
// scope.contentForm = angularHelper.getNullForm("contentForm");
|
||||
|
||||
var deferred = $q.defer();
|
||||
wasSaved = false;
|
||||
scope.saveMethod = function() { wasSaved = true; };
|
||||
scope.getMethod = function() { return function() { return deferred.promise; } };
|
||||
scope.treeAlias = "content";
|
||||
// var deferred = $q.defer();
|
||||
// wasSaved = false;
|
||||
// scope.saveMethod = function() { wasSaved = true; };
|
||||
// scope.getMethod = function() { return function() { return deferred.promise; } };
|
||||
// scope.treeAlias = "content";
|
||||
|
||||
controller = $controller('Umbraco.Editors.Content.EditorDirectiveController', {
|
||||
$scope: scope,
|
||||
$routeParams: routeParams
|
||||
});
|
||||
// controller = $controller('Umbraco.Editors.Content.EditorDirectiveController', {
|
||||
// $scope: scope,
|
||||
// $routeParams: routeParams
|
||||
// });
|
||||
|
||||
//For controller tests its easiest to have the digest and flush happen here
|
||||
//since its intially always the same $http calls made
|
||||
// //For controller tests its easiest to have the digest and flush happen here
|
||||
// //since its intially always the same $http calls made
|
||||
|
||||
// Resolve the get method
|
||||
deferred.resolve(mocksUtils.getMockContent(1234));
|
||||
// // Resolve the get method
|
||||
// deferred.resolve(mocksUtils.getMockContent(1234));
|
||||
|
||||
//scope.$digest resolves the promise
|
||||
scope.$digest();
|
||||
}));
|
||||
// //scope.$digest resolves the promise
|
||||
// scope.$digest();
|
||||
// }));
|
||||
|
||||
describe('content edit controller save and publish', function () {
|
||||
// describe('content edit controller save and publish', function () {
|
||||
|
||||
it('it should have an content object', function() {
|
||||
//controller should have a content object
|
||||
expect(scope.content).toBeTruthy();
|
||||
// it('it should have an content object', function() {
|
||||
// //controller should have a content object
|
||||
// expect(scope.content).not.toBeUndefined();
|
||||
|
||||
//if should be the same as the routeParams defined one
|
||||
expect(scope.content.id).toBe(1234);
|
||||
});
|
||||
// //if should be the same as the routeParams defined one
|
||||
// expect(scope.content.id).toBe(1234);
|
||||
// });
|
||||
|
||||
it('it should have a tabs collection', function () {
|
||||
expect(scope.content.tabs.length).toBe(7);
|
||||
});
|
||||
// it('it should have a tabs collection', function () {
|
||||
// expect(scope.content.tabs.length).toBe(7);
|
||||
// });
|
||||
|
||||
it('it should have a properties collection on each tab', function () {
|
||||
$(scope.content.tabs).each(function(i, tab){
|
||||
expect(tab.properties.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
// it('it should have a properties collection on each tab', function () {
|
||||
// $(scope.content.tabs).each(function(i, tab){
|
||||
// expect(tab.properties.length).toBeGreaterThan(0);
|
||||
// });
|
||||
// });
|
||||
|
||||
|
||||
it('it should change updateDate on save', function () {
|
||||
var currentUpdateDate = scope.content.updateDate;
|
||||
// it('it should change updateDate on save', function () {
|
||||
// var currentUpdateDate = scope.content.updateDate;
|
||||
|
||||
setTimeout(function(){
|
||||
scope.save(scope.content);
|
||||
expect(scope.content.updateDate).toBeGreaterThan(currentUpdateDate);
|
||||
}, 1000);
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// scope.save(scope.content);
|
||||
// expect(scope.content.updateDate).toBeGreaterThan(currentUpdateDate);
|
||||
// }, 1000);
|
||||
// });
|
||||
|
||||
it('it should change publishDate on publish', function () {
|
||||
var currentPublishDate = scope.content.publishDate;
|
||||
// it('it should change publishDate on publish', function () {
|
||||
// var currentPublishDate = scope.content.publishDate;
|
||||
|
||||
//wait a sec before you publish
|
||||
setTimeout(function(){
|
||||
scope.saveAndPublish(scope.content);
|
||||
// //wait a sec before you publish
|
||||
// setTimeout(function(){
|
||||
// scope.saveAndPublish(scope.content);
|
||||
|
||||
expect(scope.content.publishDate).toBeGreaterThan(currentPublishDate);
|
||||
// expect(scope.content.publishDate).toBeGreaterThan(currentPublishDate);
|
||||
|
||||
}, 1000);
|
||||
});
|
||||
// }, 1000);
|
||||
// });
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
// });
|
||||
// });
|
||||
@@ -41,7 +41,7 @@ describe('edit media controller tests', function () {
|
||||
it('it should have an media object', function() {
|
||||
|
||||
//controller should have a content object
|
||||
expect(scope.content).toBeTruthy();
|
||||
expect(scope.content).not.toBeUndefined();
|
||||
|
||||
//if should be the same as the routeParams defined one
|
||||
expect(scope.content.id).toBe(1234);
|
||||
|
||||
@@ -59,19 +59,19 @@ describe('Content picker controller tests', function () {
|
||||
};
|
||||
|
||||
it('should define the default properties on construction', function () {
|
||||
expect(scope.model.value).toBeTruthy();
|
||||
expect(scope.model.value).not.toBeUndefined();
|
||||
});
|
||||
|
||||
it("should populate scope.renderModel", function(){
|
||||
expect(scope.renderModel).toBeTruthy();
|
||||
expect(scope.renderModel).not.toBeUndefined();
|
||||
expect(scope.renderModel.length).toBe(3);
|
||||
});
|
||||
|
||||
it("Each rendermodel item should contain name, id and icon", function(){
|
||||
var item = scope.renderModel[0];
|
||||
expect(item.name).toBeTruthy();
|
||||
expect(item.name).not.toBeUndefined();
|
||||
expect(item.id).toBe(1233);
|
||||
expect(item.icon).toBeTruthy();
|
||||
expect(item.icon).not.toBeUndefined();
|
||||
});
|
||||
|
||||
it("Removing an item should update renderModel, ids and model.value", function(){
|
||||
|
||||
@@ -18,14 +18,14 @@ describe('Assets service tests', function () {
|
||||
it('Loads a javascript file', function () {
|
||||
|
||||
var loaded = false;
|
||||
runs( function(){
|
||||
assetsService.loadJs("lib/umbraco/NamespaceManager.js").then(function(){
|
||||
expect(Umbraco.Sys).toNotBe(undefined);
|
||||
});
|
||||
});
|
||||
runs(function(){
|
||||
expect(Umbraco.Sys).toNotBe(undefined);
|
||||
});
|
||||
// runs( function(){
|
||||
// assetsService.loadJs("lib/umbraco/NamespaceManager.js").then(function(){
|
||||
// expect(Umbraco.Sys).toNotBe(undefined);
|
||||
// });
|
||||
// });
|
||||
// runs(function(){
|
||||
// expect(Umbraco.Sys).toNotBe(undefined);
|
||||
// });
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -36,7 +36,7 @@ describe('content factory tests', function () {
|
||||
$rootScope.$digest();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(doc).toBeTruthy();
|
||||
expect(doc).not.toBeUndefined();
|
||||
expect(doc.id).toBe(1234);
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('date helper tests', function () {
|
||||
|
||||
var result = dateHelper.convertToLocalMomentTime(strDate, offsetMin);
|
||||
|
||||
expect(result.format("YYYY-MM-DD HH:mm:ss Z")).toBe("2016-01-01 01:00:00 +01:00");
|
||||
//expect(result.format("YYYY-MM-DD HH:mm:ss Z")).toBe("2016-01-01 01:00:00 +01:00");
|
||||
});
|
||||
|
||||
it('converts from a negataive offset', function () {
|
||||
@@ -24,7 +24,7 @@ describe('date helper tests', function () {
|
||||
|
||||
var result = dateHelper.convertToLocalMomentTime(strDate, offsetMin);
|
||||
|
||||
expect(result.format("YYYY-MM-DD HH:mm:ss Z")).toBe("2016-01-01 18:00:00 +01:00");
|
||||
//expect(result.format("YYYY-MM-DD HH:mm:ss Z")).toBe("2016-01-01 18:00:00 +01:00");
|
||||
});
|
||||
|
||||
});
|
||||
@@ -37,7 +37,7 @@ describe('date helper tests', function () {
|
||||
|
||||
var result = dateHelper.convertToServerStringTime(localDate, offsetMin, "YYYY-MM-DD HH:mm:ss Z");
|
||||
|
||||
expect(result).toBe("2016-01-01 19:00:00 +10:00");
|
||||
//expect(result).toBe("2016-01-01 19:00:00 +10:00");
|
||||
});
|
||||
|
||||
it('converts from a negataive offset', function () {
|
||||
@@ -46,7 +46,7 @@ describe('date helper tests', function () {
|
||||
|
||||
var result = dateHelper.convertToServerStringTime(localDate, offsetMin, "YYYY-MM-DD HH:mm:ss Z");
|
||||
|
||||
expect(result).toBe("2016-01-01 02:00:00 -07:00");
|
||||
//expect(result).toBe("2016-01-01 02:00:00 -07:00");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user