mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
test(studio): assert stopPropagation prevents onSelect on remove click
Review proved the existing test didn't catch a broken stopPropagation by temporarily removing it and confirming the suite still passed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b0093835fd
commit
475f764e5a
@@ -79,6 +79,10 @@ describe("FlatTextLayerList", () => {
|
|||||||
);
|
);
|
||||||
act(() => removeButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })));
|
act(() => removeButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })));
|
||||||
expect(onRemove).toHaveBeenCalledWith("a");
|
expect(onRemove).toHaveBeenCalledWith("a");
|
||||||
|
// stopPropagation on the remove button must prevent the row's own onClick
|
||||||
|
// from also firing onSelect for the removed field's key.
|
||||||
|
expect(onSelect).toHaveBeenCalledTimes(1);
|
||||||
|
expect(onSelect).not.toHaveBeenCalledWith("a");
|
||||||
act(() => root.unmount());
|
act(() => root.unmount());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user