feedback5 WAB: the collapsible bond strip test waits for the mock's answer to the teammate tap before it starts the battle (test/ui/bond-collapse.e2e.test.js; flaky 1 in 4 since 0.1.4, no product change)
.gm__watching shows at the tap, but the dev mock answers the row's g.watch 40-100 ms later (game-mock.js mockRequest). The test started the battle about 50 ms after the tap. When the answer came after that, the mock took the scouting request as a battle watch, as a server-run server does, and moved m.field and the battle frames to the teammate's field. The strip follows the field on screen, so it rightly showed that teammate, who has no bonds in the mock, and `.bslot .bond` never came (3 of 10 runs at 1920x1080). Each 640x360 touch tap takes about 100 ms, so the answer always came first there. A player never loses their own strip this way: client-side combat (the default) refuses a teammate's field while the own battle runs. Under server-run combat the late tap shows that teammate's battle with their real bonds and the eye tag. Now the test waits until m.field is the teammate's read-only board before the phase change. It also asserts that the own battle's expanded strip is the player's own (no data-owner). Every other check is unchanged. 10 of 10 runs pass. Golden unchanged.
This commit is contained in:
1 parent
714af994fc
commit
30d9a41c51
1 file changed
+6
@@ -78,6 +78,11 @@ describe('collapsible bond strip (issue #142)', { skip: !ENABLED && 'set SP_E2E=
|
||||
await activate('.team__row:not(.is-self) .team__btn');
|
||||
if (await page.$('.team__ob')) await activate('.team__ob');
|
||||
await page.waitForSelector('.gm__watching');
|
||||
// .gm__watching shows at the tap; the mock answers the row's g.watch 40–100 ms later (game-mock.js mockRequest)
|
||||
// with the teammate's read-only board. Wait for that answer: a phase change before it lets the mock apply the
|
||||
// scouting request to the battle (like a server-run server; the default client-side combat refuses it), and the
|
||||
// strip then rightly shows that teammate's bonds — none in the mock — instead of mine.
|
||||
await page.waitForFunction(() => globalThis.__MOCK__.store.get().match.field?.prep === true);
|
||||
assert.equal(await expanded(), 'false', 'watching a teammate preserves the collapse choice');
|
||||
await activate('.bonds-toggle');
|
||||
await page.waitForSelector('.bstrip__owner', { visible: true });
|
||||
@@ -89,6 +94,7 @@ describe('collapsible bond strip (issue #142)', { skip: !ENABLED && 'set SP_E2E=
|
||||
await activate('.bonds-toggle');
|
||||
await page.waitForSelector('.bslot .bond', { visible: true });
|
||||
assert.equal(await expanded(), 'true');
|
||||
assert.equal(await page.$eval('.bstrip', (el) => el.getAttribute('data-owner')), null, 'my own battle shows my own bonds again');
|
||||
await page.screenshot({ path: `${OUT}/bonds-expanded-${width}.png` });
|
||||
assert.deepEqual(errors, []);
|
||||
} finally { await page.close(); }
|
||||
|
||||
Reference in new issue
Block a user