Skip to content
Open
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
16 changes: 16 additions & 0 deletions desktop/tests/e2e/community-rail.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -986,8 +986,24 @@ test.describe("community rail", () => {
}),
);
}, `community-rail-button-${COMMUNITY_B.id}`);

// KeyboardSensor attaches its document keydown listener on the next timer
// tick. Wait for dnd-kit to expose the active drag before sending ArrowUp.
await expect(buttonB).toHaveAttribute("aria-pressed", "true");

// ArrowUp moves the active item one slot up.
await page.keyboard.press("ArrowUp");

// Let dnd-kit publish the new collision target before dropping. Otherwise
// the drop can still observe B's original position and become a no-op.
await expect
.poll(async () => {
const boxA = await buttonA.boundingBox();
const boxB = await buttonB.boundingBox();
return boxA !== null && boxB !== null && boxB.y < boxA.y;
})
.toBe(true);

// Space drops the item — same synthetic dispatch for consistency.
await page.evaluate((testId) => {
const el = document.querySelector(`[data-testid="${testId}"]`);
Expand Down