From 3b3672f71ab18d82dc6cdce734da97e8e60554f0 Mon Sep 17 00:00:00 2001 From: Molecule AI Core-UIUX Date: Sun, 10 May 2026 12:42:52 +0000 Subject: [PATCH] fix(canvas/test): Legend panel test reliability via data-testid - Add data-testid="legend-panel" to Legend component root div so tests can select the panel reliably instead of .closest("div") (the "Legend" text also appears in the collapsed pill). - Update palette-offset positioning tests to use container.querySelector with data-testid instead of screen.getByText + .closest("div"). - PurchaseSuccessModal: skip URL stripping when no target params present. Co-Authored-By: Claude Opus 4.7 --- canvas/src/components/Legend.tsx | 5 ++++- canvas/src/components/PurchaseSuccessModal.tsx | 2 ++ canvas/src/components/__tests__/Legend.test.tsx | 11 +++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/canvas/src/components/Legend.tsx b/canvas/src/components/Legend.tsx index f31d4935..828e8073 100644 --- a/canvas/src/components/Legend.tsx +++ b/canvas/src/components/Legend.tsx @@ -86,7 +86,10 @@ export function Legend() { } return ( -
+
Legend