Trying to fix js-api unit tests

This commit is contained in:
Ehsan Rezaei
2024-11-28 11:01:56 +01:00
committed by VitoAlbano
parent 8a73e46095
commit f84a64e8c7
3 changed files with 11 additions and 35 deletions

View File

@@ -64,11 +64,13 @@ describe('Auth', () => {
assert.equal(data, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1');
});
it('should return an error if wrong credential are used 403 the login fails', async () => {
it('should return an error if wrong credential are used 403 the login fails', (done) => {
authResponseEcmMock.get403Response();
const error = await alfrescoJsApi.login('wrong', 'name');
assert.equal(error.status, 403);
alfrescoJsApi.login('wrong', 'name').then(NOOP, (error: ErrorResponse) => {
assert.equal(error.status, 403);
done();
});
});
});