From 026625ec4bd299ed1de0786f375dc6f7820b6aca Mon Sep 17 00:00:00 2001 From: stroblme Date: Fri, 16 Oct 2026 14:12:10 +0200 Subject: [PATCH] Clipboard and values specs wait out the side panel's animation The clipboard spec selected text in the previous node's panel while it was still sliding out after the paste, so the selection collapsed when it unmounted and the canvas took the copy. The values spec read the panel's box mid-slide-in, where the translate leaves the width a float off 400. --- frontend/tests/clipboard.spec.ts | 5 ++++- frontend/tests/values.spec.ts | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/tests/clipboard.spec.ts b/frontend/tests/clipboard.spec.ts index 4aa42f9..fa574cd 100644 --- a/frontend/tests/clipboard.spec.ts +++ b/frontend/tests/clipboard.spec.ts @@ -65,7 +65,10 @@ test("the canvas clipboard yields to the native one", async ({ page }) => { // A text selection wins, node selection or not. React Flow's own CSS puts // `user-select: none` on every node, so the selectable text on this route is - // the floating chrome over the canvas — here the open node panel. + // the floating chrome over the canvas — here the open node panel. The paste + // opened the copy's panel, and the original's is still sliding out in front + // of it: a selection made in that one collapses when it unmounts. + await expect(page.getByTestId("node-panel")).toHaveCount(1) const selected = await page.evaluate(() => { const node = document.querySelector( '[data-testid="node-panel"]', diff --git a/frontend/tests/values.spec.ts b/frontend/tests/values.spec.ts index 2ce3b1a..96ce123 100644 --- a/frontend/tests/values.spec.ts +++ b/frontend/tests/values.spec.ts @@ -83,8 +83,11 @@ test("a dictionary shows its shape, and its contents on request", async ({ await expect(summary).toContainText("record · 3 fields") await expect(panel).not.toContainText("Recovered") - // A value cannot push the panel open, however long it is. - expect((await panel.boundingBox())?.width).toBe(PANEL_WIDTH) + // A value cannot push the panel open, however long it is. Polled, because + // the panel slides in and a box read mid-slide is a hair off 400. + await expect + .poll(async () => (await panel.boundingBox())?.width) + .toBe(PANEL_WIDTH) // The contents are one click away. await summary.click()