From 475f764e5a057488000ec3c24fef019ef6a9d80e Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Thu, 9 Jul 2026 18:11:39 -0700 Subject: [PATCH] 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 --- .../components/editor/propertyPanelFlatTextSection.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/studio/src/components/editor/propertyPanelFlatTextSection.test.tsx b/packages/studio/src/components/editor/propertyPanelFlatTextSection.test.tsx index b3c5f10a8..be526bb2a 100644 --- a/packages/studio/src/components/editor/propertyPanelFlatTextSection.test.tsx +++ b/packages/studio/src/components/editor/propertyPanelFlatTextSection.test.tsx @@ -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()); }); });