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. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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"]',
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user