[ADF-2876] retrieving user from APS api and not from js-api (#3426)

* [ADF-2876] retrieving user from APS api and not from js-api

* [ADF-2876] added support by checking externalId instead of email

* [ADF-2876] fixed auth service after rebase
This commit is contained in:
Vito
2018-06-27 10:01:17 +01:00
committed by Eugenio Romano
parent 70e23bd3eb
commit 119ebf635c
5 changed files with 47 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import { CookieService } from './cookie.service';
import { AppConfigService } from '../app-config/app-config.service';
import { setupTestBed } from '../testing/setupTestBed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { UserRepresentation } from 'alfresco-js-api';
declare let jasmine: any;
@@ -349,6 +350,18 @@ describe('AuthenticationService', () => {
it('[BPM] should return isALLProvider false', () => {
expect(authService.isALLProvider()).toBe(false);
});
it('[BPM] should be able to retrieve current logged in user', (done) => {
spyOn(apiService.getInstance().activiti.profileApi, 'getProfile').and.returnValue(
Promise.resolve((<UserRepresentation> {
email: 'fake-email'
})));
authService.getBpmLoggedUser().subscribe((fakeUser) => {
expect(fakeUser.email).toBe('fake-email');
done();
});
});
});
describe('when the setting is both ECM and BPM ', () => {