This commit is contained in:
Richard Smith
2016-05-17 15:05:53 +01:00
19 changed files with 119 additions and 113 deletions
@@ -75,6 +75,6 @@ module.exports = function (config) {
] ]
}, },
singleRun: true singleRun: false
}) })
}; };
@@ -52,6 +52,7 @@
"es6-shim": "^0.35.0", "es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2", "reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2", "rxjs": "5.0.0-beta.2",
"ng2-translate": "^1.11.2",
"zone.js": "^0.6.12", "zone.js": "^0.6.12",
"ng2-translate": "^1.11.2", "ng2-translate": "^1.11.2",
"es6-module-loader": "^0.17.8" "es6-module-loader": "^0.17.8"
@@ -73,6 +73,6 @@ module.exports = function (config) {
] ]
}, },
singleRun: true singleRun: false
}) })
}; };
@@ -82,6 +82,7 @@ describe('DocumentList', () => {
path: '<path>' path: '<path>'
}; };
documentList.currentFolderPath = root.path;
documentList.rootFolder = root; documentList.rootFolder = root;
documentList.ngOnInit(); documentList.ngOnInit();
expect(documentList.displayFolderContent).toHaveBeenCalledWith(root.path); expect(documentList.displayFolderContent).toHaveBeenCalledWith(root.path);
@@ -64,7 +64,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit
}; };
@Input() @Input()
currentFolderPath: string; currentFolderPath: string = '';
folder: NodePaging; folder: NodePaging;
errorMessage; errorMessage;
@@ -75,6 +75,6 @@ module.exports = function (config) {
] ]
}, },
singleRun: true singleRun: false
}) })
}; };
@@ -15,11 +15,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { AlfrescoLoginComponent } from './src/components/alfresco-login'; import { AlfrescoLoginComponent } from './src/components/alfresco-login.component';
import { AlfrescoAuthenticationService } from './src/services/alfresco-authentication'; import { AlfrescoAuthenticationService } from './src/services/alfresco-authentication.service';
export * from './src/components/alfresco-login'; export * from './src/components/alfresco-login.component';
export * from './src/services/alfresco-authentication'; export * from './src/services/alfresco-authentication.service';
export default { export default {
directives: [AlfrescoLoginComponent], directives: [AlfrescoLoginComponent],
@@ -18,7 +18,7 @@
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { provide } from 'angular2/core'; import { provide } from 'angular2/core';
import { AlfrescoAuthenticationService } from '../../src/services/alfresco-authentication'; import { AlfrescoAuthenticationService } from './../services/alfresco-authentication.service';
export class AuthenticationMock { export class AuthenticationMock {
@@ -32,9 +32,9 @@ import { Location, Router, RouteRegistry, ROUTER_PRIMARY_COMPONENT, Route } from
import { RootRouter } from 'angular2/src/router/router'; import { RootRouter } from 'angular2/src/router/router';
import { SpyLocation } from 'angular2/src/mock/location_mock'; import { SpyLocation } from 'angular2/src/mock/location_mock';
import { TranslateService } from 'ng2-translate/ng2-translate'; import { TranslateService } from 'ng2-translate/ng2-translate';
import { AlfrescoLoginComponent } from '../../src/components/alfresco-login'; import { AlfrescoLoginComponent } from './alfresco-login.component';
import { AuthenticationMock } from '../assets/authentication.service.mock'; import { AuthenticationMock } from './../assets/authentication.service.mock';
import { TranslationMock } from '../assets/translation.service.mock'; import { TranslationMock } from './../assets/translation.service.mock';
describe('AlfrescoLogin', () => { describe('AlfrescoLogin', () => {
let authService, location, router; let authService, location, router;
@@ -18,7 +18,7 @@
import { Component, Output, EventEmitter } from 'angular2/core'; import { Component, Output, EventEmitter } from 'angular2/core';
import { Router, ROUTER_DIRECTIVES } from 'angular2/router'; import { Router, ROUTER_DIRECTIVES } from 'angular2/router';
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from 'angular2/common'; import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from 'angular2/common';
import { AlfrescoAuthenticationService } from '../services/alfresco-authentication'; import { AlfrescoAuthenticationService } from './../services/alfresco-authentication.service';
import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate'; import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
declare let componentHandler; declare let componentHandler;
declare let __moduleName: string; declare let __moduleName: string;
@@ -27,8 +27,8 @@ declare let __moduleName: string;
selector: 'alfresco-login', selector: 'alfresco-login',
moduleId: __moduleName, moduleId: __moduleName,
directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES], directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],
templateUrl: './alfresco-login.html', templateUrl: './alfresco-login.component.html',
styleUrls: ['./alfresco-login.css'], styleUrls: ['./alfresco-login.component.css'],
pipes: [TranslatePipe] pipes: [TranslatePipe]
}) })
@@ -19,7 +19,7 @@ import { it, describe } from 'angular2/testing';
import { provide, Injector } from 'angular2/core'; import { provide, Injector } from 'angular2/core';
import { Http, HTTP_PROVIDERS, XHRBackend, Response, ResponseOptions } from 'angular2/http'; import { Http, HTTP_PROVIDERS, XHRBackend, Response, ResponseOptions } from 'angular2/http';
import { MockBackend } from 'angular2/http/testing'; import { MockBackend } from 'angular2/http/testing';
import { AlfrescoAuthenticationService } from '../../src/services/alfresco-authentication'; import { AlfrescoAuthenticationService } from './alfresco-authentication.service';
describe('AlfrescoAuthentication', () => { describe('AlfrescoAuthentication', () => {
@@ -5,16 +5,16 @@ module.exports = function (config) {
basePath: '.', basePath: '.',
frameworks: ['jasmine'], frameworks: ['jasmine-ajax', 'jasmine'],
files: [ files: [
// paths loaded by Karma // paths loaded by Karma
{pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false}, {pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false},
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false}, {pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
{pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: false}, {pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: false},
{pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, watched: false}, {pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, served: true, watched: false},
{pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, watched: false}, {pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, served: true, watched: false},
{pattern: 'node_modules/angular2/bundles/http.dev.js', included: true, watched: false}, {pattern: 'node_modules/angular2/bundles/http.dev.js', included: true, served: true, watched: false},
{pattern: 'node_modules/angular2/bundles/router.dev.js', included: true, watched: false}, {pattern: 'node_modules/angular2/bundles/router.dev.js', included: true, watched: false},
{pattern: 'node_modules/alfresco-core-rest-api/bundle.js', included: true, watched: false}, {pattern: 'node_modules/alfresco-core-rest-api/bundle.js', included: true, watched: false},
{pattern: 'node_modules/ng2-translate/bundles/ng2-translate.js', included: true, watched: false}, {pattern: 'node_modules/ng2-translate/bundles/ng2-translate.js', included: true, watched: false},
@@ -53,6 +53,7 @@ module.exports = function (config) {
plugins: [ plugins: [
'karma-jasmine', 'karma-jasmine',
'karma-coverage', 'karma-coverage',
'karma-jasmine-ajax',
'karma-chrome-launcher', 'karma-chrome-launcher',
'karma-mocha-reporter' 'karma-mocha-reporter'
], ],
@@ -73,6 +74,8 @@ module.exports = function (config) {
{type: 'json', subdir: '.', file: 'coverage-final.json'}, {type: 'json', subdir: '.', file: 'coverage-final.json'},
{type: 'html'} {type: 'html'}
] ]
} },
singleRun: false
}) })
}; };
@@ -65,6 +65,7 @@
"karma-chrome-launcher": "~1.0.1", "karma-chrome-launcher": "~1.0.1",
"karma-coverage": "^1.0.0", "karma-coverage": "^1.0.0",
"karma-jasmine": "~1.0.2", "karma-jasmine": "~1.0.2",
"karma-jasmine-ajax": "^0.1.13",
"karma-mocha-reporter": "^2.0.3", "karma-mocha-reporter": "^2.0.3",
"license-check": "^1.0.4", "license-check": "^1.0.4",
"remap-istanbul": "^0.6.3", "remap-istanbul": "^0.6.3",
@@ -17,7 +17,7 @@
import { it, describe, expect, injectAsync, TestComponentBuilder } from 'angular2/testing'; import { it, describe, expect, injectAsync, TestComponentBuilder } from 'angular2/testing';
import { FileUploadingDialogComponent } from '../../src/components/file-uploading-dialog.component'; import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
describe('FileUploadDialog', () => { describe('FileUploadDialog', () => {
@@ -19,7 +19,7 @@
import { TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS } from 'angular2/platform/testing/browser'; import { TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS } from 'angular2/platform/testing/browser';
import { it, describe, expect, injectAsync, beforeEachProviders, TestComponentBuilder, setBaseTestProviders } from 'angular2/testing'; import { it, describe, expect, injectAsync, beforeEachProviders, TestComponentBuilder, setBaseTestProviders } from 'angular2/testing';
import { provide } from 'angular2/core'; import { provide } from 'angular2/core';
import { UploadButtonComponent } from '../../src/components/upload-button.component'; import { UploadButtonComponent } from './upload-button.component';
import { TranslateService } from 'ng2-translate/ng2-translate'; import { TranslateService } from 'ng2-translate/ng2-translate';
import { TranslationMock } from '../assets/translation.service.mock'; import { TranslationMock } from '../assets/translation.service.mock';
@@ -16,8 +16,8 @@
*/ */
import { it, describe, beforeEach, expect } from 'angular2/testing'; import { it, describe, beforeEach, expect } from 'angular2/testing';
import { UploadService } from '../../src/services/upload.service'; import { UploadService } from './upload.service';
import { FileModel } from '../../src/models/file.model'; import { FileModel } from './../models/file.model';
declare let jasmine: any; declare let jasmine: any;