feedback1 draft-info: the devices e2e left-detail-card check taps a shop card that completes no merge

At 640×360 the mock's first shop card completes a merge; its detail opens in
the left slot and moves to the right one 20-40 ms later because the elite's
lit board tile lies under the left slot (screens/game.js dSide, DESIGN
§20.11). The check caught the left card only sometimes and then measured the
corner buttons against the right one. It now taps a card without a merge and
asserts the card stays left.
This commit is contained in:
sganggs committed 2026-10-03 16:33:54 +08:00
1 parent 263f274d27
commit ad8d0bf6b1
1 file changed
+5 -1
+5 -1
View File
@@ -250,10 +250,14 @@ describe('multi-device (Chrome device emulation)', { skip: !ENABLED && 'set SP_E
for (const dev of ['phone-min', 'iphone14']) {
test(`${dev}: the left detail card leaves the corner buttons (⚙ 📖 ⛶) usable`, async () => {
const { page, problems } = await open(dev, 'phase=PREP');
const card = await page.$eval('.shopbar__cards .scard:not(.scard--sold):not(.is-disabled)', (el) => { const b = el.getBoundingClientRect(); return { x: b.left + b.width / 2, y: b.top + b.height / 2 }; });
// not a card that completes a merge: it lights its elite's board tile, and the card moves to the right slot when that
// tile lies under the left one (screens/game.js dSide, DESIGN §20.11) — 20–40 ms after it opened on the left, at
// 640×360 for the mock's first card, so the left card was caught only sometimes and the check below saw the right one
const card = await page.$eval('.shopbar__cards .scard:not(.scard--sold):not(.is-disabled):not(.is-merge)', (el) => { const b = el.getBoundingClientRect(); return { x: b.left + b.width / 2, y: b.top + b.height / 2 }; });
await page.touchscreen.tap(card.x, card.y);
await page.waitForSelector('.dpanel:not(.dpanel--right)', { timeout: 3000 });
await sleep(400);
assert.equal(await page.$('.dpanel.dpanel--right'), null, `${dev}: the card stays in the left slot`);
const covered = await page.evaluate(() => [...document.querySelectorAll('.gm__corner .gm__gear')].map((el) => {
const r = el.getBoundingClientRect();
const t = document.elementFromPoint(r.left + r.width / 2, r.top + r.height / 2);