AAE-30882 - Checking why is ok locally but fails on CI

This commit is contained in:
VitoAlbano
2025-09-05 13:44:31 +01:00
committed by Vito Albano
parent 3a3d202b54
commit c5c558d04d
3 changed files with 25 additions and 3 deletions

View File

@@ -18,6 +18,7 @@
import assert from 'assert';
import { AlfrescoApi } from '../src';
import { BpmAuthMock, EcmAuthMock, OAuthMock } from './mockObjects';
import nock from 'nock';
describe('Basic configuration test', () => {
describe('config parameter ', () => {
@@ -209,16 +210,23 @@ describe('Basic configuration test', () => {
});
describe('login', () => {
beforeEach(() => {
nock.cleanAll();
});
it('Should login be rejected if username or password are not provided', async () => {
const hostEcm = 'https://testServer.com:1616';
const authEcmMock = new EcmAuthMock(hostEcm); // ✅ HAS MOCK
const config = {
hostEcm: 'https://testServer.com:1616',
hostEcm,
contextRoot: 'strangeContextRoot',
withCredentials: true
};
const alfrescoJsApi = new AlfrescoApi(config);
let error;
authEcmMock.get401InvalidRequest();
try {
await alfrescoJsApi.login(undefined, undefined);
} catch (e) {