mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Fix unit tests core
This commit is contained in:
@@ -121,12 +121,14 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
|
|||||||
try {
|
try {
|
||||||
return await this.processAuth.login(username, password);
|
return await this.processAuth.login(username, password);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
return Promise.reject(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (this.isECMProvider()) {
|
} else if (this.isECMProvider()) {
|
||||||
try {
|
try {
|
||||||
return await this.contentAuth.login(username, password);
|
return await this.contentAuth.login(username, password);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
return Promise.reject(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (this.isALLProvider()) {
|
} else if (this.isALLProvider()) {
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ describe('AuthenticationService', () => {
|
|||||||
},
|
},
|
||||||
(err: any) => {
|
(err: any) => {
|
||||||
expect(err).toBeDefined();
|
expect(err).toBeDefined();
|
||||||
expect(authService.getToken()).toBe(undefined);
|
expect(authService.getToken()).toBe(null);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -374,9 +374,9 @@ describe('AuthenticationService', () => {
|
|||||||
it('[ALL] should return both ECM and BPM tickets after the login done', (done) => {
|
it('[ALL] should return both ECM and BPM tickets after the login done', (done) => {
|
||||||
const disposableLogin = basicAlfrescoAuthService.login('fake-username', 'fake-password').subscribe(() => {
|
const disposableLogin = basicAlfrescoAuthService.login('fake-username', 'fake-password').subscribe(() => {
|
||||||
expect(authService.isLoggedIn()).toBe(true);
|
expect(authService.isLoggedIn()).toBe(true);
|
||||||
expect(authService.getToken()).toEqual('fake-post-ticket');
|
expect(basicAlfrescoAuthService.getTicketEcm()).toEqual('fake-post-ticket');
|
||||||
// cspell: disable-next
|
// cspell: disable-next
|
||||||
expect(authService.getToken()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
|
expect(basicAlfrescoAuthService.getTicketBpm()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
|
||||||
expect(authService.isBpmLoggedIn()).toBe(true);
|
expect(authService.isBpmLoggedIn()).toBe(true);
|
||||||
expect(authService.isEcmLoggedIn()).toBe(true);
|
expect(authService.isEcmLoggedIn()).toBe(true);
|
||||||
disposableLogin.unsubscribe();
|
disposableLogin.unsubscribe();
|
||||||
|
|||||||
Reference in New Issue
Block a user