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:
Vito Albano
2026-05-07 09:12:07 +01:00
committed by GitHub
parent 9cdacf3ebf
commit 57bf066164
54 changed files with 2127 additions and 922 deletions
+26 -20
View File
@@ -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) => {