Fix unit tests core

This commit is contained in:
Amedeo Lepore
2023-08-31 10:27:07 +02:00
committed by eromano
parent 5b2746185b
commit cbb501155f
2 changed files with 5 additions and 3 deletions
@@ -121,12 +121,14 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
try {
return await this.processAuth.login(username, password);
} catch (e) {
return Promise.reject(e);
}
} else if (this.isECMProvider()) {
try {
return await this.contentAuth.login(username, password);
} catch (e) {
return Promise.reject(e);
}
} else if (this.isALLProvider()) {
@@ -261,7 +261,7 @@ describe('AuthenticationService', () => {
},
(err: any) => {
expect(err).toBeDefined();
expect(authService.getToken()).toBe(undefined);
expect(authService.getToken()).toBe(null);
done();
});
@@ -374,9 +374,9 @@ describe('AuthenticationService', () => {
it('[ALL] should return both ECM and BPM tickets after the login done', (done) => {
const disposableLogin = basicAlfrescoAuthService.login('fake-username', 'fake-password').subscribe(() => {
expect(authService.isLoggedIn()).toBe(true);
expect(authService.getToken()).toEqual('fake-post-ticket');
expect(basicAlfrescoAuthService.getTicketEcm()).toEqual('fake-post-ticket');
// cspell: disable-next
expect(authService.getToken()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
expect(basicAlfrescoAuthService.getTicketBpm()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
expect(authService.isBpmLoggedIn()).toBe(true);
expect(authService.isEcmLoggedIn()).toBe(true);
disposableLogin.unsubscribe();