mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2200] fixed problem with redirection url (#2877)
* [ADF-2200] fixed wrong handling of redirectUrl * [ADF-2200] fixed problem with redirection url * [ADF-2200] fixed redirection config path * [ADF-2200] fixed wrong fdescribe test * [ADF-2200] removed authserviceMock and fixed some tests
This commit is contained in:
@@ -258,6 +258,18 @@ describe('AuthenticationService', () => {
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.isEcmLoggedIn()).toBe(false);
|
||||
});
|
||||
|
||||
it('[ECM] should set/get redirectUrl when provider is ECM', () => {
|
||||
authService.setRedirectUrl({provider: 'ECM', url: 'some-url' } );
|
||||
|
||||
expect(authService.getRedirectUrl(preferences.authType)).toBe('some-url');
|
||||
});
|
||||
|
||||
it('[ECM] should set/get redirectUrl when provider is BPM', () => {
|
||||
authService.setRedirectUrl({provider: 'BPM', url: 'some-url' } );
|
||||
|
||||
expect(authService.getRedirectUrl(preferences.authType)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the setting is BPM', () => {
|
||||
@@ -367,6 +379,18 @@ describe('AuthenticationService', () => {
|
||||
'status': 403
|
||||
});
|
||||
});
|
||||
|
||||
it('[BPM] should set/get redirectUrl when provider is BPM', () => {
|
||||
authService.setRedirectUrl({provider: 'BPM', url: 'some-url' } );
|
||||
|
||||
expect(authService.getRedirectUrl(preferences.authType)).toBe('some-url');
|
||||
});
|
||||
|
||||
it('[BPM] should set/get redirectUrl when provider is ECM', () => {
|
||||
authService.setRedirectUrl({provider: 'ECM', url: 'some-url' } );
|
||||
|
||||
expect(authService.getRedirectUrl(preferences.authType)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the setting is both ECM and BPM ', () => {
|
||||
@@ -396,7 +420,7 @@ describe('AuthenticationService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[ALL] should return login fail if only ECM call fail', (done) => {
|
||||
it('[ALL] should return login fail if only ECM call fail', (done) => {
|
||||
authService.login('fake-username', 'fake-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
@@ -417,7 +441,7 @@ describe('AuthenticationService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[ALL] should return login fail if only BPM call fail', (done) => {
|
||||
it('[ALL] should return login fail if only BPM call fail', (done) => {
|
||||
authService.login('fake-username', 'fake-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
@@ -461,11 +485,24 @@ describe('AuthenticationService', () => {
|
||||
'status': 403
|
||||
});
|
||||
});
|
||||
|
||||
it('[ALL] should set/get redirectUrl when provider is ALL', () => {
|
||||
authService.setRedirectUrl({provider: 'ALL', url: 'some-url' } );
|
||||
|
||||
expect(authService.getRedirectUrl(preferences.authType)).toBe('some-url');
|
||||
});
|
||||
|
||||
it('[ALL] should set/get redirectUrl when provider is BPM', () => {
|
||||
authService.setRedirectUrl({provider: 'BPM', url: 'some-url' } );
|
||||
|
||||
expect(authService.getRedirectUrl(preferences.authType)).toBe('some-url');
|
||||
});
|
||||
|
||||
it('[ALL] should set/get redirectUrl when provider is ECM', () => {
|
||||
authService.setRedirectUrl({provider: 'ECM', url: 'some-url' } );
|
||||
|
||||
expect(authService.getRedirectUrl(preferences.authType)).toBe('some-url');
|
||||
});
|
||||
});
|
||||
|
||||
it('should set/get redirectUrl', () => {
|
||||
authService.setRedirectUrl('some-url');
|
||||
|
||||
expect(authService.getRedirectUrl()).toBe('some-url');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user