mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[AAE-9094] - Fix app breaking when configured with BASIC auth (#7672)
This commit is contained in:
@@ -92,6 +92,7 @@ describe('UserAccessService', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(jwtHelperService, 'getValueFromLocalToken').and.returnValue(undefined);
|
||||
getAccessFromApiSpy = spyOn(oauth2Service, 'get').and.returnValue(of(userAccessMock));
|
||||
appConfigService.config.authType = 'OAUTH';
|
||||
});
|
||||
|
||||
it('should return true when the user has one of the global roles', async () => {
|
||||
@@ -137,5 +138,12 @@ describe('UserAccessService', () => {
|
||||
|
||||
expect(getAccessFromApiSpy).toHaveBeenCalledWith({ url: `${ fakeIdentityHost }/v1/identity/roles` });
|
||||
});
|
||||
|
||||
it('should not fetch the access from the API if is not configured with OAUTH', async () => {
|
||||
appConfigService.config.authType = 'BASIC';
|
||||
await userAccessService.fetchUserAccess();
|
||||
|
||||
expect(getAccessFromApiSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user