diff --git a/cvat-core/src/object-state.js b/cvat-core/src/object-state.js index ac4e18f6bb5a..93d17d4827a3 100644 --- a/cvat-core/src/object-state.js +++ b/cvat-core/src/object-state.js @@ -425,7 +425,7 @@ ObjectState.prototype.delete.implementation = async function (frame, force) { if (this.__internal && this.__internal.delete) { if (!Number.isInteger(+frame) || +frame < 0) { - throw ArgumentError('Frame argument must be a non negative integer'); + throw new ArgumentError('Frame argument must be a non negative integer'); } return this.__internal.delete(frame, force); diff --git a/cvat-core/tests/api/annotations.js b/cvat-core/tests/api/annotations.js index 57fe808eca94..ae0572cfe38b 100644 --- a/cvat-core/tests/api/annotations.js +++ b/cvat-core/tests/api/annotations.js @@ -367,7 +367,7 @@ describe('Feature: save annotations', () => { const annotations = await task.annotations.get(0); expect(task.annotations.hasUnsavedChanges()).toBe(false); - await annotations[0].delete(); + await annotations[0].delete(0); expect(task.annotations.hasUnsavedChanges()).toBe(true); await task.annotations.save(); expect(task.annotations.hasUnsavedChanges()).toBe(false); @@ -413,7 +413,7 @@ describe('Feature: save annotations', () => { const annotations = await job.annotations.get(0); expect(job.annotations.hasUnsavedChanges()).toBe(false); - await annotations[0].delete(); + await annotations[0].delete(0); expect(job.annotations.hasUnsavedChanges()).toBe(true); await job.annotations.save(); expect(job.annotations.hasUnsavedChanges()).toBe(false); @@ -436,7 +436,7 @@ describe('Feature: save annotations', () => { return result; }; - await annotations[0].delete(); + await annotations[0].delete(0); await job.annotations.save(); serverProxy.annotations.updateAnnotations = oldImplementation; diff --git a/cvat-core/tests/api/object-state.js b/cvat-core/tests/api/object-state.js index 1cf592ac4d43..92a6c8157db6 100644 --- a/cvat-core/tests/api/object-state.js +++ b/cvat-core/tests/api/object-state.js @@ -289,7 +289,7 @@ describe('Feature: delete object', () => { const task = (await window.cvat.tasks.get({ id: 100 }))[0]; const annotationsBefore = await task.annotations.get(0); const { length } = annotationsBefore; - await annotationsBefore[0].delete(); + await annotationsBefore[0].delete(0); const annotationsAfter = await task.annotations.get(0); expect(annotationsAfter).toHaveLength(length - 1); }); @@ -298,7 +298,7 @@ describe('Feature: delete object', () => { const task = (await window.cvat.tasks.get({ id: 101 }))[0]; const annotationsBefore = await task.annotations.get(0); const { length } = annotationsBefore; - await annotationsBefore[0].delete(); + await annotationsBefore[0].delete(0); const annotationsAfter = await task.annotations.get(0); expect(annotationsAfter).toHaveLength(length - 1); });