Stage 17 (#9): animated shuffle — tiles hop along a low parabola to new slots
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 8s
CI / integration (pull_request) Successful in 11s
CI / ui (pull_request) Successful in 28s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 53s
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 8s
CI / integration (pull_request) Successful in 11s
CI / ui (pull_request) Successful in 28s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 53s
Give each rack slot a stable id permuted with the letters on shuffle, so the keyed rack reorders (rather than relabelling in place) and Svelte's animate directive fires. hop flies each tile along a parabola (apogee ~half a tile height) with a duration that scales with the horizontal distance (arc length): the longest 1<->7 swap takes ~0.5s, shorter swaps land sooner. Ordinary reflow (place/recall) stays instant via a guard. e2e locks that a shuffle preserves the rack's tile multiset.
This commit is contained in:
@@ -48,6 +48,19 @@ test('a pending tile recalls on double-tap, not on a single tap', async ({ page
|
||||
await expect(page.locator('[data-cell].pending')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('shuffle reorders the rack but keeps the same tiles', async ({ page }) => {
|
||||
await openGame(page);
|
||||
const before = await page.locator('.rack .tile').allTextContents();
|
||||
expect(before.length).toBeGreaterThan(1);
|
||||
|
||||
await page.locator('button:has-text("🔀")').click(); // the shuffle tab (no pending tiles)
|
||||
await page.waitForTimeout(650); // let the hop animation settle
|
||||
|
||||
// Same multiset of tiles after the shuffle — no tile is dropped or duplicated.
|
||||
const after = await page.locator('.rack .tile').allTextContents();
|
||||
expect([...after].sort()).toEqual([...before].sort());
|
||||
});
|
||||
|
||||
test('history slides the board down and closes on a board tap', async ({ page }) => {
|
||||
await openGame(page);
|
||||
await page.locator('.burger').click();
|
||||
|
||||
Reference in New Issue
Block a user