AAE-23572 all builds but the extensions one

This commit is contained in:
Wojciech Duda
2024-07-03 15:54:13 +02:00
parent 54b34f513e
commit 2a62c1e2a9
23 changed files with 1860 additions and 518 deletions

View File

@@ -17,7 +17,7 @@
import assert from 'assert';
import { AlfrescoApi, ContentAuth } from '../src';
import { EcmAuthMock as AuthEcmMock } from '../test/mockObjects';
import { EcmAuthMock as AuthEcmMock } from './mockObjects';
describe('Ecm Auth test', () => {
const hostEcm = 'https://127.0.0.1:8080';

View File

@@ -18,6 +18,8 @@
import assert from 'assert';
import { AlfrescoApi, ContentApi, Oauth2Auth } from '../src';
import { EcmAuthMock, OAuthMock } from './mockObjects';
import { TextEncoder, TextDecoder } from 'util';
Object.assign(global, { TextDecoder, TextEncoder });
import jsdom from 'jsdom';
const { JSDOM } = jsdom;
@@ -169,7 +171,6 @@ describe('Oauth2 test', () => {
});
it('should refresh token when the login not use the implicitFlow ', function (done) {
this.timeout(3000);
oauth2Mock.get200Response();
const oauth2Auth = new Oauth2Auth(
@@ -202,10 +203,9 @@ describe('Oauth2 test', () => {
}, 600);
oauth2Auth.login('admin', 'admin');
});
}, 3000);
it('should not hang the app also if teh logout is missing', function (done) {
this.timeout(3000);
oauth2Mock.get200Response();
const oauth2Auth = new Oauth2Auth(
@@ -237,7 +237,7 @@ describe('Oauth2 test', () => {
}, 600);
oauth2Auth.login('admin', 'admin');
});
}, 3000);
it('should emit a token_issued event if login is ok ', (done) => {
oauth2Mock.get200Response();
@@ -426,7 +426,6 @@ describe('Oauth2 test', () => {
// TODO: very flaky test, fails on different machines if running slow, might relate to `this.timeout`
// eslint-disable-next-line ban/ban
xit('should extend content session after oauth token refresh', function (done) {
this.timeout(3000);
oauth2Mock.get200Response();
authResponseMock.get200ValidTicket();
@@ -464,9 +463,8 @@ describe('Oauth2 test', () => {
});
alfrescoApi.login('admin', 'admin');
this.timeout(3000);
alfrescoApi.refreshToken();
});
}, 3000);
it('isLoggedIn should return true if the api is logged in', (done) => {
oauth2Mock.get200Response();

View File

@@ -9,6 +9,6 @@
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"types": ["mocha"]
"types": ["jest"]
}
}