Missing client files, excluding node_modules

This commit is contained in:
Per Ploug Krogslund
2013-06-10 10:44:40 -02:00
parent 6b6ece01f6
commit 47f1dcf4e5
1121 changed files with 190073 additions and 1 deletions

View File

@@ -0,0 +1,53 @@
// base path, that will be used to resolve files and exclude
basePath = '../..';
// list of files / patterns to load in the browser
files = [
ANGULAR_SCENARIO,
ANGULAR_SCENARIO_ADAPTER,
'test/e2e/**/*.scenario.js'
];
// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots' || 'progress'
reporters = 'progress';
// these are default values, just to show available options
// web server port
port = 8080;
// cli runner port
runnerPort = 9100;
urlRoot = '/__testacular/';
proxies = {
'/': 'http://localhost:3000/'
};
// enable / disable colors in the output (reporters and logs)
colors = true;
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel = LOG_INFO;
// enable / disable watching file and executing tests whenever any file changes
autoWatch = false;
// polling interval in ms (ignored on OS that support inotify)
autoWatchInterval = 0;
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari
// - PhantomJS
browsers = ['Chrome'];
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun = true;

View File

@@ -0,0 +1,54 @@
// base path, that will be used to resolve files and exclude
basePath = '../..';
// list of files / patterns to load in the browser
files = [
JASMINE,
JASMINE_ADAPTER,
'lib/jquery/jquery-1.8.2.min.js',
'lib/angular/angular.min.js',
'test/lib/angular/angular-mocks.js',
'src/app.js',
'src/common/**/*.js',
'src/views/**/*.controller.js',
'test/unit/**/*.spec.js'
];
// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots' || 'progress'
reporters = 'progress';
// these are default values, just to show available options
// web server port
port = 8089;
// cli runner port
runnerPort = 9109;
// enable / disable colors in the output (reporters and logs)
colors = true;
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel = LOG_INFO;
// enable / disable watching file and executing tests whenever any file changes
autoWatch = false;
// polling interval in ms (ignored on OS that support inotify)
autoWatchInterval = 0;
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari
// - PhantomJS
browsers = ['Chrome'];
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun = true;

View File

@@ -0,0 +1,23 @@
describe('admin edit user', function() {
beforeEach(function() {
browser().navigateTo('/admin/users/new');
input('user.email').enter('admin@abc.com');
input('user.password').enter('changeme');
element('button.login').click();
});
it('enables the save button when the user info is filled in correctly', function() {
expect(element('button.save:disabled').count()).toBe(1);
input('user.email').enter('test@app.com');
input('user.lastName').enter('Test');
input('user.firstName').enter('App');
input('user.password').enter('t');
input('password').enter('t');
element('#password').query(function(elements, done) {
expect(element('#passwordRepeat').text()).toContain(elements.text());
done();
});
expect(element('button.save:disabled').count()).toBe(0);
});
});

View File

@@ -0,0 +1,10 @@
describe('my app', function() {
beforeEach(function() {
browser().navigateTo('/');
});
it('should be publicly accessible and default route to be /projectsinfo', function() {
expect(browser().location().path()).toBe("/projectsinfo");
});
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
describe('edit content controller tests', function () {
var scope, controller, routeParams;
routeParams = {id: 1234, create: false};
beforeEach(module('umbraco'));
beforeEach(inject(function($rootScope, $controller) {
scope = $rootScope.$new();
controller = $controller('Umbraco.Editors.ContentEditController', {
$scope: scope,
$routeParams : routeParams
});
}));
describe('content edit controller save and publish', function () {
it('it should have an content object', function () {
expect(scope.content).toNotBe(undefined);
expect(scope.content.id).toBe(1234);
});
it('it should have a tabs collection', function () {
expect(scope.content.tabs.length).toBe(5);
});
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;
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;
//wait a sec before you publish
setTimeout(function(){
scope.saveAndPublish(scope.content);
expect(scope.content.publishDate).toBeGreaterThan(currentPublishDate);
}, 1000);
});
});
});

View File

@@ -0,0 +1,28 @@
describe('content factory tests', function () {
var $scope, contentFactory;
beforeEach(module('umbraco.mocks.resources'));
beforeEach(inject(function($injector) {
$scope = $injector.get('$rootScope');
contentFactory = $injector.get('contentResource');
}));
describe('global content factory crud', function () {
it('should return a content object, given an id', function () {
var doc1 = contentFactory.getContent(1234);
expect(doc1).toNotBe(undefined);
expect(doc1.id).toBe(1234);
});
it('should return a content children collection given an id', function () {
var collection = contentFactory.getChildren(1234, undefined);
expect(collection.resultSet.length).toBe(10);
collection = contentFactory.getChildren(1234,{take: 5, offset: 1, filter: ""});
expect(collection.resultSet.length).toBe(5);
});
});
});

View File

@@ -0,0 +1,25 @@
describe('content type factory tests', function () {
var $scope, contentTypeFactory;
beforeEach(module('umbraco.mocks.resources'));
beforeEach(inject(function($injector) {
$scope = $injector.get('$rootScope');
contentTypeFactory = $injector.get('contentTypeResource');
}));
describe('global content type factory crud', function () {
it('should return a content type object, given an id', function () {
var ct1 = contentTypeFactory.getContentType(1234);
expect(ct1).toNotBe(undefined);
expect(ct1.id).toBe(1234);
});
it('should return a allowed content type collection given a document id', function () {
var collection = contentTypeFactory.getAllowedTypes(1234);
expect(collection.length).toBe(3);
});
});
});

View File

@@ -0,0 +1,31 @@
describe('notification tests', function () {
var $scope, notifications;
beforeEach(module('umbraco.services'));
beforeEach(inject(function($injector) {
$scope = $injector.get('$rootScope');
notifications = $injector.get('notificationsService');
}));
describe('global notifications crud', function () {
it('should allow to add, get and remove notifications', function () {
var not1 = notifications.success("success", "something great happened");
var not2 = notifications.error("error", "something great happened");
var not3 = notifications.warning("warning", "something great happened");
expect(notifications.getCurrent().length).toBe(3);
//remove at index 0
notifications.remove(0);
expect(notifications.getCurrent().length).toEqual(2);
expect(notifications.getCurrent()[0].headline).toBe("error");
notifications.removeAll();
expect(notifications.getCurrent().length).toEqual(0);
});
});
});