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

@@ -56,15 +56,16 @@ describe('Upload', () => {
assert.equal(data.entry.name, 'testFile.txt');
});
it('upload file should get 409 if new name clashes with an existing file in the current parent folder', (done) => {
it('upload file should get 409 if new name clashes with an existing file in the current parent folder', async () => {
uploadMock.get409CreationFileNewNameClashes();
const file = createTestFileStream('testFile.txt');
uploadApi.uploadFile(file).catch((error: any) => {
try {
await uploadApi.uploadFile(file);
assert.fail('Expected an error to be thrown');
} catch (error) {
assert.equal(error.status, 409);
done();
});
}
});
it('upload file should get 200 and rename if the new name clashes with an existing file in the current parent folder and autorename is true', async () => {