Skip to content

Commit 2dd7eb7

Browse files
test(e2e): stabilize covered comment navigation
1 parent 8fa30c9 commit 2dd7eb7

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

‎e2e/sidecar.e2e.ts‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -754,12 +754,23 @@ test("a compact new-comment sheet blocks navigation and restores editor focus",
754754
let sheet = await openDraft();
755755
let destination = await decisions.boundingBox();
756756
expect(destination).not.toBeNull();
757-
await page.mouse.click(
758-
destination!.x + destination!.width / 2,
759-
destination!.y + destination!.height / 2,
760-
);
761-
await expect(sheet).toHaveCount(0);
757+
let destinationPoint = {
758+
x: destination!.x + destination!.width / 2,
759+
y: destination!.y + destination!.height / 2,
760+
};
761+
await expect.poll(() =>
762+
page.evaluate(
763+
({ x, y }) => !!document.elementFromPoint(x, y)?.closest("[data-plan-comment-sheet]"),
764+
destinationPoint,
765+
)
766+
).toBe(true);
767+
await page.mouse.click(destinationPoint.x, destinationPoint.y);
768+
await expect(sheet).toBeVisible();
762769
await expect(plan).toHaveAttribute("aria-pressed", "true");
770+
await page.locator("[data-plan-comment-sheet-backdrop]").click({
771+
position: { x: 10, y: 10 },
772+
});
773+
await expect(sheet).toHaveCount(0);
763774
await expect(editor).toBeFocused();
764775

765776
sheet = await openDraft();

0 commit comments

Comments
 (0)