mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
Trying to fix js-api unit tests
This commit is contained in:
committed by
Vito Albano
parent
3039d1612f
commit
2aa4b5951e
@@ -40,6 +40,11 @@ describe('Auth', () => {
|
||||
nodeMock = new NodeMock(ECM_HOST);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
authResponseEcmMock.cleanAll();
|
||||
nodeMock.cleanAll();
|
||||
});
|
||||
|
||||
describe('With Authentication', () => {
|
||||
let alfrescoJsApi: AlfrescoApi;
|
||||
|
||||
@@ -59,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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user