From 68bc0c7949ae310e4bf51a9e1fa11619225937ec Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 18 Jul 2016 13:20:33 +0100 Subject: [PATCH] fix unit test response auth problem --- .../src/services/AlfrescoAuthenticationECM.service.ts | 2 +- .../AlfrescoAuthenticationService.service.spec.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts index d1d8b21cff..1a8266eee4 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationECM.service.ts @@ -72,7 +72,7 @@ export class AlfrescoAuthenticationECM extends AlfrescoAuthenticationBase implem return Observable.fromPromise(this.callApiLogin(username, password)) .map((response: any) => { - return {type: this.TYPE, ticket: response.entry.id}; + return {type: this.TYPE, ticket: response}; }) .catch(this.handleError); } diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.spec.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.spec.ts index 32903dbc43..3ec6b1a0aa 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthenticationService.service.spec.ts @@ -33,12 +33,9 @@ describe('AlfrescoAuthentication', () => { service; fakePromiseECM = new Promise(function (resolve, reject) { - resolve({ - entry: { - userId: 'fake-username', - id: 'fake-post-ticket-ECM' - } - }); + resolve( + 'fake-post-ticket-ECM' + ); reject({ response: { error: 'fake-error'