mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
migrate js-api tests from Jest to Node.js native test runner (#12104)
This commit is contained in:
@@ -16,15 +16,17 @@
|
||||
*/
|
||||
|
||||
import assert from 'assert';
|
||||
import { resetGlobalMockAgent } from '../mockObjects/base.mock';
|
||||
import { AlfrescoApi, GsSitesApi } from '../../src';
|
||||
import { EcmAuthMock, GsSitesApiMock } from '../mockObjects';
|
||||
import { describe, it, beforeEach, afterEach } from 'node:test';
|
||||
|
||||
describe('Governance API test', () => {
|
||||
let authResponseMock: EcmAuthMock;
|
||||
let gsSitesApiMock: GsSitesApiMock;
|
||||
let gsSitesApi: GsSitesApi;
|
||||
|
||||
beforeEach(() => {
|
||||
beforeEach(async () => {
|
||||
const hostEcm = 'https://127.0.0.1:8080';
|
||||
|
||||
authResponseMock = new EcmAuthMock(hostEcm);
|
||||
@@ -37,14 +39,18 @@ describe('Governance API test', () => {
|
||||
});
|
||||
|
||||
gsSitesApi = new GsSitesApi(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login('admin', 'admin');
|
||||
});
|
||||
|
||||
it('should getRMSite return the RM site', (done) => {
|
||||
afterEach(() => {
|
||||
resetGlobalMockAgent();
|
||||
});
|
||||
|
||||
it('should getRMSite return the RM site', async () => {
|
||||
gsSitesApiMock.get200Response();
|
||||
|
||||
gsSitesApi.getRMSite().then((data) => {
|
||||
assert.equal(data.entry.description, 'Records Management Description Test');
|
||||
done();
|
||||
});
|
||||
const data = await gsSitesApi.getRMSite();
|
||||
assert.equal(data.entry.description, 'Records Management Description Test');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user