diff --git a/frontend/src/lib/document/annotation/AnnotationLayer.svelte.spec.ts b/frontend/src/lib/document/annotation/AnnotationLayer.svelte.spec.ts index b134c50f..3c5aea0b 100644 --- a/frontend/src/lib/document/annotation/AnnotationLayer.svelte.spec.ts +++ b/frontend/src/lib/document/annotation/AnnotationLayer.svelte.spec.ts @@ -107,7 +107,7 @@ describe('AnnotationLayer', () => { }); await expect.element(page.getByTestId('annotation-ann-1')).toBeInTheDocument(); - expect(page.getByTestId('annotation-delete-ann-1').query()).toBeNull(); + await expect.element(page.getByTestId('annotation-delete-ann-1')).not.toBeInTheDocument(); }); it('does not show delete button when canDraw is false even if annotation is active', async () => { @@ -120,6 +120,6 @@ describe('AnnotationLayer', () => { }); await expect.element(page.getByTestId('annotation-ann-1')).toBeInTheDocument(); - expect(page.getByTestId('annotation-delete-ann-1').query()).toBeNull(); + await expect.element(page.getByTestId('annotation-delete-ann-1')).not.toBeInTheDocument(); }); }); diff --git a/frontend/src/lib/document/annotation/AnnotationShape.svelte.spec.ts b/frontend/src/lib/document/annotation/AnnotationShape.svelte.spec.ts index 87f1cae1..a896489b 100644 --- a/frontend/src/lib/document/annotation/AnnotationShape.svelte.spec.ts +++ b/frontend/src/lib/document/annotation/AnnotationShape.svelte.spec.ts @@ -45,7 +45,7 @@ describe('AnnotationShape', () => { onpointerleave: () => {} }); - expect(page.getByTestId('annotation-delete-ann-1').query()).toBeNull(); + await expect.element(page.getByTestId('annotation-delete-ann-1')).not.toBeInTheDocument(); }); it('does not show delete button when showDelete is true but neither hovered nor active', async () => { @@ -60,7 +60,7 @@ describe('AnnotationShape', () => { onpointerleave: () => {} }); - expect(page.getByTestId('annotation-delete-ann-1').query()).toBeNull(); + await expect.element(page.getByTestId('annotation-delete-ann-1')).not.toBeInTheDocument(); }); it('shows delete button when showDelete is true and isHovered is true', async () => {