AAE-30882 - Fixed unit test for js-api

This commit is contained in:
VitoAlbano
2025-08-22 12:48:30 +01:00
committed by Vito Albano
parent e400bc1068
commit c17c8232af
43 changed files with 575 additions and 460 deletions

View File

@@ -161,19 +161,17 @@ describe('Node', () => {
});
});
it('should return 404 error on initiateFolderSizeCalculation API call if nodeId is not found', (done) => {
it('should return 404 error on initiateFolderSizeCalculation API call if nodeId is not found', async () => {
nodeMock.post404NodeIdNotFound();
nodesApi.initiateFolderSizeCalculation('b4cff62a-664d-4d45-9302-98723eac1319').then(
() => {},
(err) => {
const { error } = JSON.parse(err.response.text);
assert.equal(error.statusCode, 404);
assert.equal(error.errorKey, 'framework.exception.EntityNotFound');
assert.equal(error.briefSummary, '11207522 The entity with id: b4cff62a-664d-4d45-9302-98723eac1319 was not found');
done();
}
);
try {
await nodesApi.initiateFolderSizeCalculation('b4cff62a-664d-4d45-9302-98723eac1319');
} catch (err) {
const error = err.response.data.error;
assert.equal(error.statusCode, 404);
assert.equal(error.errorKey, 'framework.exception.EntityNotFound');
assert.equal(error.briefSummary, '11207522 The entity with id: b4cff62a-664d-4d45-9302-98723eac1319 was not found');
}
});
it('should return size details on getFolderSizeInfo API call if everything is ok', (done) => {
@@ -196,7 +194,7 @@ describe('Node', () => {
nodesApi.getFolderSizeInfo('b4cff62a-664d-4d45-9302-98723eac1319', '5ade426e-8a04-4d50-9e42-6e8a041d50f3').then(
() => {},
(err) => {
const { error } = JSON.parse(err.response.text);
const error = err.response.data.error;
assert.equal(error.statusCode, 404);
assert.equal(error.errorKey, 'jobId does not exist');
assert.equal(error.briefSummary, '11207212 jobId does not exist');