Fixed unit tests

main
Boris Sekachev 6 years ago
parent c55cbdefe5
commit e478637e88

@ -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);

@ -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;

@ -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);
});

Loading…
Cancel
Save