From 357a4d4920a263d45fd7e965bec3aed349da4e49 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 6 Sep 2026 19:14:37 -0700 Subject: [PATCH] test(e2e): scope paired preview link checks to confirmation (#18924) --- .../paired-remote-html-preview-local-render.spec.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/e2e/paired-remote-html-preview-local-render.spec.ts b/tests/e2e/paired-remote-html-preview-local-render.spec.ts index dd849091294..7351c5e0978 100644 --- a/tests/e2e/paired-remote-html-preview-local-render.spec.ts +++ b/tests/e2e/paired-remote-html-preview-local-render.spec.ts @@ -582,7 +582,10 @@ test('renders a paired HTML doc as a document browser tab while the host gains n return { before, after: document.activeElement?.tagName ?? null } }) console.log(`[preview-e2e] before-focus ${JSON.stringify(guestFocus)}`) - const confirmationTitle = page.getByRole('heading', { name: 'Open link to example.com?' }) + const confirmation = page.getByRole('dialog', { name: 'Open link to example.com?' }) + const confirmationTitle = confirmation.getByRole('heading', { + name: 'Open link to example.com?' + }) await expect .poll( async () => { @@ -601,8 +604,8 @@ test('renders a paired HTML doc as a document browser tab while the host gains n } ) .toBe(true) - await expect(page.getByText(EXTERNAL_LINK_URL, { exact: true })).toBeVisible() - await page.getByRole('button', { name: 'Cancel', exact: true }).click() + await expect(confirmation.getByText(EXTERNAL_LINK_URL, { exact: true })).toBeVisible() + await confirmation.getByRole('button', { name: 'Cancel', exact: true }).click() await expect(confirmationTitle).not.toBeVisible() const afterCancel = await readPairedHtmlPreviewInventory(page, inventoryArgs) expect({ @@ -620,7 +623,7 @@ test('renders a paired HTML doc as a document browser tab while the host gains n } await page.mouse.click(point.x, point.y) await expect(confirmationTitle).toBeVisible({ timeout: 30_000 }) - await page.getByRole('button', { name: 'Open link', exact: true }).click() + await confirmation.getByRole('button', { name: 'Open link', exact: true }).click() await expect .poll( async () => {