From b4e90cb71a127a1e2e2ee8991346ae457694e1e8 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 29 Apr 2016 12:09:30 +0100 Subject: [PATCH] #17 Provide translationServiceMock to fix the failures test --- .../src/alfresco-authentication.service.d.ts | 4 +-- .../src/alfresco-authentication.service.js | 13 +++----- .../alfresco-authentication.service.js.map | 2 +- .../src/alfresco-authentication.service.ts | 6 +--- .../src/alfresco-login.component.spec.js | 33 +++++++++++++------ .../src/alfresco-login.component.spec.js.map | 2 +- .../src/alfresco-login.component.spec.ts | 26 +++++++++++---- .../ng2-alfresco-login/tsconfig.json | 12 +++++-- 8 files changed, 59 insertions(+), 39 deletions(-) diff --git a/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.d.ts b/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.d.ts index dc5f9db48e..e414d200c7 100644 --- a/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.d.ts +++ b/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.d.ts @@ -1,12 +1,10 @@ import { Observable } from 'rxjs/Rx'; import { Http } from 'angular2/http'; -import { AlfrescoSettingsService } from '../../ng2-alfresco-core/services'; /** * The AlfrescoAuthenticationService provide the login service and store the token in the localStorage */ export declare class AlfrescoAuthenticationService { http: Http; - private settings; token: string; private _host; private _baseUrl; @@ -14,7 +12,7 @@ export declare class AlfrescoAuthenticationService { * Constructor * @param http */ - constructor(http: Http, settings: AlfrescoSettingsService); + constructor(http: Http); /** * The method return tru if the user is logged in * @returns {boolean} diff --git a/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js b/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js index e1fc98b367..74ec2f638a 100644 --- a/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js +++ b/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js @@ -1,4 +1,4 @@ -System.register(['angular2/core', 'rxjs/Rx', 'angular2/http', '../../ng2-alfresco-core/services'], function(exports_1, context_1) { +System.register(['angular2/core', 'rxjs/Rx', 'angular2/http'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { @@ -10,7 +10,7 @@ System.register(['angular2/core', 'rxjs/Rx', 'angular2/http', '../../ng2-alfresc var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var core_1, Rx_1, http_1, services_1; + var core_1, Rx_1, http_1; var AlfrescoAuthenticationService; return { setters:[ @@ -22,9 +22,6 @@ System.register(['angular2/core', 'rxjs/Rx', 'angular2/http', '../../ng2-alfresc }, function (http_1_1) { http_1 = http_1_1; - }, - function (services_1_1) { - services_1 = services_1_1; }], execute: function() { /** @@ -35,13 +32,11 @@ System.register(['angular2/core', 'rxjs/Rx', 'angular2/http', '../../ng2-alfresc * Constructor * @param http */ - function AlfrescoAuthenticationService(http, settings) { + function AlfrescoAuthenticationService(http) { this.http = http; - this.settings = settings; this._host = 'http://192.168.99.100:8080'; this._baseUrl = this._host + '/alfresco/service/api/'; this.token = localStorage.getItem('token'); - this._host = settings.host; } /** * The method return tru if the user is logged in @@ -134,7 +129,7 @@ System.register(['angular2/core', 'rxjs/Rx', 'angular2/http', '../../ng2-alfresc }; AlfrescoAuthenticationService = __decorate([ core_1.Injectable(), - __metadata('design:paramtypes', [http_1.Http, services_1.AlfrescoSettingsService]) + __metadata('design:paramtypes', [http_1.Http]) ], AlfrescoAuthenticationService); return AlfrescoAuthenticationService; }()); diff --git a/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js.map b/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js.map index 029e58a351..cc903b36c5 100644 --- a/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js.map +++ b/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.js.map @@ -1 +1 @@ -{"version":3,"file":"alfresco-authentication.service.js","sourceRoot":"","sources":["alfresco-authentication.service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YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;oBACvC,CAAC;gBACL,CAAC;gBAED;;;mBAGG;gBACH,8CAAM,GAAN;oBACI,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;oBACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBAEjC,MAAM,CAAC,eAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC/B,CAAC;gBAED;;;;mBAIG;gBACK,mDAAW,GAAnB,UAAoB,KAAc;oBAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrB,MAAM,CAAC,eAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC;gBAClE,CAAC;gBA/GL;oBAAC,iBAAU,EAAE;;iDAAA;gBAgHb,oCAAC;YAAD,CAAC,AA/GD,IA+GC;YA/GD,yEA+GC,CAAA"} \ No newline at end of file +{"version":3,"file":"alfresco-authentication.service.js","sourceRoot":"","sources":["alfresco-authentication.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;YAsBA;;eAEG;YAEH;gBAMI;;;mBAGG;gBACH,uCAAmB,IAAS;oBAAT,SAAI,GAAJ,IAAI,CAAK;oBAPpB,UAAK,GAAU,4BAA4B,CAAC;oBAC5C,aAAQ,GAAU,IAAI,CAAC,KAAK,GAAG,wBAAwB,CAAC;oBAO5D,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC/C,CAAC;gBACD;;;mBAGG;gBACH,kDAAU,GAAV;oBACI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;gBAED;;;;;;mBAMG;gBACH,6CAAK,GAAL,UAAM,MAAa,EAAE,QAAe,EAAE,QAAe;oBACjD,EAAE,CAAC,CAAC,MAAM,KAAK,KAAK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ng2-alfresco-login/src/alfresco-authentication.service.ts index 4315d0e146..46b737171b 100644 --- a/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.ts +++ b/ng2-components/ng2-alfresco-login/src/alfresco-authentication.service.ts @@ -17,8 +17,6 @@ import {Injectable} from 'angular2/core'; import {Observable} from 'rxjs/Rx'; import {Http, Headers, URLSearchParams, Response} from 'angular2/http'; -import {AlfrescoSettingsService} from '../../ng2-alfresco-core/services'; - declare let xml2json:any; @@ -36,10 +34,8 @@ export class AlfrescoAuthenticationService { * Constructor * @param http */ - constructor(public http:Http, - private settings: AlfrescoSettingsService) { + constructor(public http:Http) { this.token = localStorage.getItem('token'); - this._host = settings.host; } /** * The method return tru if the user is logged in diff --git a/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js b/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js index a0502b7434..fdd941eb59 100644 --- a/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js +++ b/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js @@ -1,8 +1,8 @@ -System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angular2/core', './alfresco-login.component', 'rxjs/Rx', './alfresco-authentication.service', 'angular2/src/router/router', 'angular2/router', 'angular2/src/mock/location_mock'], function(exports_1, context_1) { +System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angular2/core', './alfresco-login.component', 'rxjs/Rx', './alfresco-authentication.service', 'angular2/src/router/router', 'angular2/router', 'angular2/src/mock/location_mock', 'ng2-translate/ng2-translate'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; - var browser_1, testing_1, core_1, alfresco_login_component_1, Rx_1, alfresco_authentication_service_1, router_1, router_2, location_mock_1; - var AuthenticationMock; + var browser_1, testing_1, core_1, alfresco_login_component_1, Rx_1, alfresco_authentication_service_1, router_1, router_2, location_mock_1, ng2_translate_1; + var AuthenticationMock, TranslationMock; return { setters:[ function (browser_1_1) { @@ -31,6 +31,9 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul }, function (location_mock_1_1) { location_mock_1 = location_mock_1_1; + }, + function (ng2_translate_1_1) { + ng2_translate_1 = ng2_translate_1_1; }], execute: function() { AuthenticationMock = (function () { @@ -50,6 +53,15 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul }; return AuthenticationMock; }()); + TranslationMock = (function () { + function TranslationMock() { + } + TranslationMock.prototype.setDefaultLang = function () { + }; + TranslationMock.prototype.use = function () { + }; + return TranslationMock; + }()); testing_1.describe('AlfrescoLogin', function () { var authService, location, router; testing_1.setBaseTestProviders(browser_1.TEST_BROWSER_PLATFORM_PROVIDERS, browser_1.TEST_BROWSER_APPLICATION_PROVIDERS); @@ -60,14 +72,15 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul router_2.RouteRegistry, core_1.provide(router_2.Location, { useClass: location_mock_1.SpyLocation }), core_1.provide(router_2.ROUTER_PRIMARY_COMPONENT, { useValue: alfresco_login_component_1.AlfrescoLoginComponent }), - core_1.provide(router_2.Router, { useClass: router_1.RootRouter }) + core_1.provide(router_2.Router, { useClass: router_1.RootRouter }), + core_1.provide(ng2_translate_1.TranslateService, { useClass: TranslationMock }) ]; }); testing_1.beforeEach(testing_1.inject([router_2.Router, router_2.Location], function (r, l) { router = r; location = l; })); - testing_1.it('should render `Login` form with input fields user and password with default value', testing_1.injectAsync([testing_1.TestComponentBuilder, alfresco_authentication_service_1.AlfrescoAuthenticationService, router_2.Router], function (tcb, authService, router) { + testing_1.it('should render `Login` form with input fields user and password with default value', testing_1.injectAsync([testing_1.TestComponentBuilder], function (tcb) { return tcb .createAsync(alfresco_login_component_1.AlfrescoLoginComponent) .then(function (fixture) { @@ -79,7 +92,7 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul testing_1.expect(element.querySelector('input[type="text"]').value).toEqual(''); }); })); - testing_1.it('should render the new values after change the user and password values', testing_1.injectAsync([testing_1.TestComponentBuilder, alfresco_authentication_service_1.AlfrescoAuthenticationService, router_2.Router], function (tcb, authService, router) { + testing_1.it('should render the new values after change the user and password values', testing_1.injectAsync([testing_1.TestComponentBuilder], function (tcb) { return tcb .createAsync(alfresco_login_component_1.AlfrescoLoginComponent) .then(function (fixture) { @@ -92,7 +105,7 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul testing_1.expect(compiled.querySelector('input[type="text"]').value).toEqual('my username'); }); })); - testing_1.it('should navigate to Home route after the login OK ', testing_1.injectAsync([testing_1.TestComponentBuilder, alfresco_authentication_service_1.AlfrescoAuthenticationService, router_2.Router], function (tcb, authService, router) { + testing_1.it('should navigate to Home route after the login OK ', testing_1.injectAsync([testing_1.TestComponentBuilder], function (tcb) { return tcb .createAsync(alfresco_login_component_1.AlfrescoLoginComponent) .then(function (fixture) { @@ -108,7 +121,7 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul testing_1.expect(router.navigate).toHaveBeenCalledWith(['Home']); }); })); - testing_1.it('should return error with a wrong username ', testing_1.injectAsync([testing_1.TestComponentBuilder, alfresco_authentication_service_1.AlfrescoAuthenticationService, router_2.Router], function (tcb, authService, router) { + testing_1.it('should return error with a wrong username ', testing_1.injectAsync([testing_1.TestComponentBuilder], function (tcb) { return tcb .createAsync(alfresco_login_component_1.AlfrescoLoginComponent) .then(function (fixture) { @@ -122,7 +135,7 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul testing_1.expect(fixture.componentInstance.error).toBe(true); }); })); - testing_1.it('should return error with a wrong password ', testing_1.injectAsync([testing_1.TestComponentBuilder, alfresco_authentication_service_1.AlfrescoAuthenticationService, router_2.Router], function (tcb, authService, router) { + testing_1.it('should return error with a wrong password ', testing_1.injectAsync([testing_1.TestComponentBuilder], function (tcb) { return tcb .createAsync(alfresco_login_component_1.AlfrescoLoginComponent) .then(function (fixture) { @@ -136,7 +149,7 @@ System.register(['angular2/platform/testing/browser', 'angular2/testing', 'angul testing_1.expect(fixture.componentInstance.error).toBe(true); }); })); - testing_1.it('should return error with a wrong username and password ', testing_1.injectAsync([testing_1.TestComponentBuilder, alfresco_authentication_service_1.AlfrescoAuthenticationService, router_2.Router], function (tcb, authService, router) { + testing_1.it('should return error with a wrong username and password ', testing_1.injectAsync([testing_1.TestComponentBuilder], function (tcb) { return tcb .createAsync(alfresco_login_component_1.AlfrescoLoginComponent) .then(function (fixture) { diff --git a/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js.map b/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js.map index 4f6d2b9553..267f42525c 100644 --- a/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js.map +++ b/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.js.map @@ -1 +1 @@ -{"version":3,"file":"alfresco-login.component.spec.js","sourceRoot":"","sources":["alfresco-login.component.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BA;gBAAA;oBACW,aAAQ,GAAU,gBAAgB,CAAC;gBAa9C,CAAC;gBAXG,kCAAK,GAAL,UAAM,MAAa,EAAE,QAAe,EAAE,QAAe;oBACjD,EAAE,CAAC,CAAC,QAAQ,KAAK,eAAe,IAAI,QAAQ,KAAK,eAAe,CAAC,CAAC,CAAC;wBAC/D,MAAM,CAAC,eAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;oBAC/B,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,eAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;oBACjD,CAAC;gBACL,CAAC;gBAED,yCAAY,GAAZ;oBACI,MAAM,CAAC,CAAC,cAAO,CAAC,+DAA6B,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;gBACtE,CAAC;gBACL,yBAAC;YAAD,CAAC,AAdD,IAcC;YAED,kBAAQ,CAAC,eAAe,EAAE;gBACtB,IAAI,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC;gBAElC,8BAAoB,CA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I,CAAC,IAAI,CAAC,CAAC;oBACvD,CAAC,CAAC,CAAC;gBACX,CAAC,CAAC,CAAC,CAAC;YAER,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"alfresco-login.component.spec.js","sourceRoot":"","sources":["alfresco-login.component.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BA;gBAAA;oBACW,aAAQ,GAAU,gBAAgB,CAAC;gBAa9C,CAAC;gBAXG,kCAAK,GAAL,UAAM,MAAa,EAAE,QAAe,EAAE,QAAe;oBACjD,EAAE,CAAC,CAAC,QAAQ,KAAK,eAAe,IAAI,QAAQ,KAAK,eAAe,CAAC,CAAC,CAAC;wBAC/D,MAAM,CAAC,eAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;oBAC/B,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,eAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;oBACjD,CAAC;gBACL,CAAC;gBAED,yCAAY,GAAZ;oBACI,MAAM,CAAC,CAAC,cAAO,CAAC,+DAA6B,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;gBACtE,CAAC;gBACL,yBAAC;YAAD,CAAC,AAdD,IAcC;YAED;gBAAA;gBAQA,CAAC;gBAPG,wCAAc,GAAd;gBAEA,CAAC;gBAED,6BAAG,GAAH;gBAEA,CAAC;gBACL,sBAAC;YAAD,CAAC,AARD,IAQC;YAED,kBAAQ,CAAC,eAAe,EAAE;gBACtB,IAAI,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC;gBAElC,8BAAoB,CAAC,yCAA+B,EAAE,4CAAkC,CAAC,CAAC;gBAE1F,6BAAmB,CAAC;oBAChB,WAAW,GAAG,IAAI,kBAAkB,EAAE,CAAC;oBAEvC,MAAM,CAAC;wBACH,WAAW,CAAC,YAAY,EAAE;wBAC1B,sBAAa;wBACb,cAAO,CAAC,iBAA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EJ,YAAE,CAAC,yDAAyD,EAAE,qBAAW,CAAC,CAAC,8BAAoB,CAAC,EAAE,UAAC,GAAwB;oBACvH,MAAM,CAAC,GAAG;yBACL,WAAW,CAAC,iDAAsB,CAAC;yBACnC,IAAI,CAAC,UAAC,OAAO;wBACV,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC5C,IAAI,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC;wBAElD,IAAI,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;wBAChE,IAAI,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;wBAE5D,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,qBAAqB,CAAC;wBACpF,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,qBAAqB,CAAC;wBAEpF,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;wBAEzC,gBAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACvD,CAAC,CAAC,CAAC;gBACX,CAAC,CAAC,CAAC,CAAC;YAER,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.ts b/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.ts index b0ec044a3a..6ea6b4c48f 100644 --- a/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.ts +++ b/ng2-components/ng2-alfresco-login/src/alfresco-login.component.spec.ts @@ -24,6 +24,7 @@ import { RootRouter } from 'angular2/src/router/router'; import { Location, Router, RouteRegistry, ROUTER_PRIMARY_COMPONENT, Route } from 'angular2/router'; import { SpyLocation } from 'angular2/src/mock/location_mock'; import {dispatchEvent} from 'angular2/src/testing/utils'; +import {TranslateService} from 'ng2-translate/ng2-translate'; class AuthenticationMock { public mockName:string = 'Mocked Service'; @@ -41,6 +42,16 @@ class AuthenticationMock { } } +class TranslationMock { + setDefaultLang() { + + } + + use() { + + } +} + describe('AlfrescoLogin', () => { let authService, location, router; @@ -54,7 +65,8 @@ describe('AlfrescoLogin', () => { RouteRegistry, provide(Location, {useClass: SpyLocation}), provide(ROUTER_PRIMARY_COMPONENT, {useValue: AlfrescoLoginComponent}), - provide(Router, {useClass: RootRouter}) + provide(Router, {useClass: RootRouter}), + provide(TranslateService, {useClass: TranslationMock}) ]; }); @@ -63,7 +75,7 @@ describe('AlfrescoLogin', () => { location = l; })); - it('should render `Login` form with input fields user and password with default value', injectAsync([TestComponentBuilder, AlfrescoAuthenticationService, Router], (tcb:TestComponentBuilder, authService:AlfrescoAuthenticationService, router:Router) => { + it('should render `Login` form with input fields user and password with default value', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { return tcb .createAsync(AlfrescoLoginComponent) .then((fixture) => { @@ -77,7 +89,7 @@ describe('AlfrescoLogin', () => { })); - it('should render the new values after change the user and password values', injectAsync([TestComponentBuilder, AlfrescoAuthenticationService, Router], (tcb:TestComponentBuilder, authService:AlfrescoAuthenticationService, router:Router) => { + it('should render the new values after change the user and password values', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { return tcb .createAsync(AlfrescoLoginComponent) .then((fixture) => { @@ -94,7 +106,7 @@ describe('AlfrescoLogin', () => { }); })); - it('should navigate to Home route after the login OK ', injectAsync([TestComponentBuilder, AlfrescoAuthenticationService, Router], (tcb:TestComponentBuilder, authService:AlfrescoAuthenticationService, router:Router) => { + it('should navigate to Home route after the login OK ', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { return tcb .createAsync(AlfrescoLoginComponent) .then((fixture) => { @@ -115,7 +127,7 @@ describe('AlfrescoLogin', () => { }); })); - it('should return error with a wrong username ', injectAsync([TestComponentBuilder, AlfrescoAuthenticationService, Router], (tcb:TestComponentBuilder, authService:AlfrescoAuthenticationService, router:Router) => { + it('should return error with a wrong username ', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { return tcb .createAsync(AlfrescoLoginComponent) .then((fixture) => { @@ -134,7 +146,7 @@ describe('AlfrescoLogin', () => { }); })); - it('should return error with a wrong password ', injectAsync([TestComponentBuilder, AlfrescoAuthenticationService, Router], (tcb:TestComponentBuilder, authService:AlfrescoAuthenticationService, router:Router) => { + it('should return error with a wrong password ', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { return tcb .createAsync(AlfrescoLoginComponent) .then((fixture) => { @@ -153,7 +165,7 @@ describe('AlfrescoLogin', () => { }); })); - it('should return error with a wrong username and password ', injectAsync([TestComponentBuilder, AlfrescoAuthenticationService, Router], (tcb:TestComponentBuilder, authService:AlfrescoAuthenticationService, router:Router) => { + it('should return error with a wrong username and password ', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { return tcb .createAsync(AlfrescoLoginComponent) .then((fixture) => { diff --git a/ng2-components/ng2-alfresco-login/tsconfig.json b/ng2-components/ng2-alfresco-login/tsconfig.json index 2f3531e7b9..4e5005a7ef 100644 --- a/ng2-components/ng2-alfresco-login/tsconfig.json +++ b/ng2-components/ng2-alfresco-login/tsconfig.json @@ -10,9 +10,15 @@ "noImplicitAny": false, "declaration": true }, + "files":[ + "src/alfresco-login.component.ts", + "src/alfresco-login.component.spec.ts", + "src/alfresco-authentication.service.ts", + "src/alfresco-authentication.service.spec.ts" + ], "exclude": [ - "node_modules", - "typings/main", - "typings/main.d.ts" + "**/node_modules", + "**/typings/main", + "**/typings/main.d.ts" ] }