mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-30882 Remove superagent for fetch (#11856)
* [AAE-30882] - Remove superagent for fetch * [AAE-30882] - Fixing comments * [AAE-30882] - fixde failing unit tests * [AAE-30882] - fixde failing unit tests * [AAE-30882] - fixd sonarcloud comment
This commit is contained in:
@@ -23,29 +23,35 @@ describe('Oauth2 Implicit flow test', () => {
|
||||
let alfrescoJsApi: AlfrescoApi;
|
||||
|
||||
beforeEach(() => {
|
||||
const mockLocation: any = {
|
||||
ancestorOrigins: null,
|
||||
hash: '',
|
||||
host: 'dummy.com',
|
||||
port: '80',
|
||||
protocol: 'http:',
|
||||
hostname: 'dummy.com',
|
||||
href: 'http://localhost/',
|
||||
origin: 'dummy.com',
|
||||
pathname: null,
|
||||
search: null,
|
||||
assign: (url: string) => {
|
||||
mockLocation.href = url;
|
||||
},
|
||||
reload: null,
|
||||
replace: null
|
||||
};
|
||||
|
||||
(globalThis as any).window = { location: mockLocation, addEventListener: () => {}, removeEventListener: () => {} };
|
||||
(globalThis as any).document = { getElementById: () => null, cookie: '' };
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
hostEcm: ''
|
||||
});
|
||||
Object.defineProperty(window, 'location', {
|
||||
writable: true,
|
||||
value: {
|
||||
ancestorOrigins: null,
|
||||
hash: '',
|
||||
host: 'dummy.com',
|
||||
port: '80',
|
||||
protocol: 'http:',
|
||||
hostname: 'dummy.com',
|
||||
href: 'http://localhost/',
|
||||
origin: 'dummy.com',
|
||||
pathname: null,
|
||||
search: null,
|
||||
assign: (url: string) => {
|
||||
window.location.href = url;
|
||||
},
|
||||
reload: null,
|
||||
replace: null
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
delete (globalThis as any).window;
|
||||
delete (globalThis as any).document;
|
||||
});
|
||||
|
||||
it('should throw an error if redirectUri is not present', (done) => {
|
||||
|
||||
Reference in New Issue
Block a user