Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Mar 25, 2020
1 parent c55cbde commit e478637
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cvat-core/src/object-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions cvat-core/tests/api/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions cvat-core/tests/api/object-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand Down

0 comments on commit e478637

Please sign in to comment.