Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions packages/react-grab/e2e/copy-feedback.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,16 @@ test.describe("Copy Feedback Behavior", () => {
await reactGrab.hoverElement("li:first-child");
await reactGrab.waitForSelectionBox();

const boundsBefore = await reactGrab.getSelectionBoxBounds();

await reactGrab.page.keyboard.down(reactGrab.modifierKey);
await reactGrab.page.keyboard.down("c");
await reactGrab.clickElement("li:first-child");
await reactGrab.page.waitForTimeout(100);
await reactGrab.hoverElement("h1");
await reactGrab.waitForSelectionBox();

const boundsAfter = await reactGrab.getSelectionBoxBounds();
const boundsSizeChanged =
boundsBefore &&
boundsAfter &&
(boundsBefore.width !== boundsAfter.width ||
boundsBefore.height !== boundsAfter.height);
await reactGrab.page.waitForTimeout(FEEDBACK_DURATION_MS + 500);

expect(boundsBefore).not.toBeNull();
expect(await reactGrab.isOverlayVisible()).toBe(true);
const boundsAfter = await reactGrab.getSelectionBoxBounds();
expect(boundsAfter).not.toBeNull();
expect(boundsSizeChanged).toBe(true);

await reactGrab.page.keyboard.up("c");
await reactGrab.page.keyboard.up(reactGrab.modifierKey);
Expand Down
Loading
Loading