feat(viewer): show delete icon directly on transcription annotation (#339) #348

Merged
marcel merged 5 commits from feat/issue-339-delete-icon-on-annotation into main 2026-04-26 21:56:38 +02:00
Showing only changes of commit e95a9312e8 - Show all commits

View File

@@ -113,6 +113,28 @@ describe('AnnotationShape', () => {
expect(onDeleteRequest).toHaveBeenCalledOnce();
});
it('does not call onclick when delete button is clicked', async () => {
const onclick = vi.fn();
const onDeleteRequest = vi.fn();
render(AnnotationShape, {
annotation: makeAnnotation(),
isHovered: true,
isActive: false,
showDelete: true,
onDeleteRequest,
onclick,
onpointerenter: () => {},
onpointerleave: () => {}
});
const deleteBtn = page.getByTestId('annotation-delete-ann-1');
await deleteBtn.click();
expect(onclick).not.toHaveBeenCalled();
expect(onDeleteRequest).toHaveBeenCalledOnce();
});
it('calls onDeleteRequest when Delete key is pressed on the annotation', async () => {
const onDeleteRequest = vi.fn();