mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Ability to check if loggedIn based on provider (#5598)
* Provide a way to check if loggedIn based on provider * Fix the comments * Add schema validation for provider
This commit is contained in:
@@ -76,6 +76,11 @@ describe('AuthenticationService', () => {
|
||||
expect(apiService.getInstance).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should check if loggedin on ECM in case the provider is ECM', () => {
|
||||
spyOn(authService, 'isEcmLoggedIn').and.returnValue(true);
|
||||
expect(authService.isLoggedInWith('ECM')).toBe(true);
|
||||
});
|
||||
|
||||
it('should require remember me set for ECM check', () => {
|
||||
spyOn(cookie, 'isEnabled').and.returnValue(true);
|
||||
spyOn(authService, 'isRememberMeSet').and.returnValue(false);
|
||||
@@ -198,6 +203,11 @@ describe('AuthenticationService', () => {
|
||||
expect(apiService.getInstance).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should check if loggedin on BPM in case the provider is BPM', () => {
|
||||
spyOn(authService, 'isBpmLoggedIn').and.returnValue(true);
|
||||
expect(authService.isLoggedInWith('BPM')).toBe(true);
|
||||
});
|
||||
|
||||
it('should not require cookie service enabled for BPM check', () => {
|
||||
spyOn(cookie, 'isEnabled').and.returnValue(false);
|
||||
spyOn(authService, 'isRememberMeSet').and.returnValue(false);
|
||||
|
Reference in New Issue
Block a user