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:
Vance Ingalls
2026-07-14 15:51:54 -07:00
co-authored by Claude Sonnet 5
parent b0093835fd
commit 475f764e5a
@@ -79,6 +79,10 @@ describe("FlatTextLayerList", () => {
);
act(() => removeButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })));
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());
});
});