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:
@@ -19,6 +19,7 @@ import assert from 'assert';
|
||||
import { AlfrescoApi, ContentApi, Oauth2Auth } from '../src';
|
||||
import { EcmAuthMock, OAuthMock } from './mockObjects';
|
||||
import { jest } from '@jest/globals';
|
||||
import * as browserUtils from '../src/utils/is-browser';
|
||||
|
||||
describe('Oauth2 test', () => {
|
||||
let alfrescoJsApi: AlfrescoApi;
|
||||
@@ -65,7 +66,7 @@ describe('Oauth2 test', () => {
|
||||
|
||||
afterEach(() => {
|
||||
authResponseMock.cleanAll();
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('Discovery urls', () => {
|
||||
@@ -189,7 +190,7 @@ describe('Oauth2 test', () => {
|
||||
});
|
||||
|
||||
it('should refresh token when the login not use the implicitFlow ', (done) => {
|
||||
jest.spyOn(window, 'document', 'get').mockReturnValueOnce(undefined);
|
||||
jest.spyOn(browserUtils, 'isBrowser').mockReturnValue(false);
|
||||
oauth2Mock.get200Response();
|
||||
|
||||
const oauth2Auth = new Oauth2Auth(
|
||||
@@ -224,7 +225,7 @@ describe('Oauth2 test', () => {
|
||||
});
|
||||
|
||||
it('should not hang the app also if the logout is missing', (done) => {
|
||||
jest.spyOn(window, 'document', 'get').mockReturnValueOnce(undefined);
|
||||
jest.spyOn(browserUtils, 'isBrowser').mockReturnValue(false);
|
||||
oauth2Mock.get200Response();
|
||||
|
||||
const oauth2Auth = new Oauth2Auth(
|
||||
|
||||
Reference in New Issue
Block a user