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,12 +16,14 @@
|
||||
*/
|
||||
|
||||
import assert from 'assert';
|
||||
import { resetGlobalMockAgent } from './mockObjects/base.mock';
|
||||
import { AlfrescoApi, AlfrescoApiClient, DateAlfresco } from '../src';
|
||||
import { EcmAuthMock } from './mockObjects';
|
||||
import { describe, it, beforeEach, afterEach } from 'node:test';
|
||||
|
||||
describe('Alfresco Core API Client', () => {
|
||||
describe('type conversion', () => {
|
||||
it('should return the username after login', (done) => {
|
||||
it('should return the username after login', async () => {
|
||||
const authResponseEcmMock = new EcmAuthMock('https://127.0.0.1:8080');
|
||||
|
||||
authResponseEcmMock.get201Response();
|
||||
@@ -32,7 +34,7 @@ describe('Alfresco Core API Client', () => {
|
||||
|
||||
alfrescoJsApi.login('admin', 'admin').then(() => {
|
||||
assert.equal(alfrescoJsApi.getEcmUsername(), 'admin');
|
||||
done();
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -97,6 +99,10 @@ describe('Alfresco Core API Client', () => {
|
||||
alfrescoApiClient.config = { ticketEcm: mockConfigTicket };
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
resetGlobalMockAgent();
|
||||
});
|
||||
|
||||
it('should return the supplied ticket', () => {
|
||||
const ticket = alfrescoApiClient.getAlfTicket(mockArgTicket);
|
||||
const expectedResult = alfTicketParam + mockArgTicket;
|
||||
|
||||
Reference in New Issue
Block a user