mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
Fix two Ubuntu flakes: try more road for a Bounce Road rival, and wait for the board's focus before the last F press
AI Assisted
This commit is contained in:
1 parent
a0ac6eb655
commit
23ac3a9c19
2 files changed
+7
-1
No files matched your search
@@ -193,7 +193,10 @@ const eventsOf = (round, type) => round.events.filter((e) => e.type === type);
|
||||
// A rival of `kind` put at (x, d), still and on the ground, going nowhere on
|
||||
// its own.
|
||||
function bounceRival(round, kind, x, d, over = {}) {
|
||||
const car = bounce.spawnRival(round, kind, steady, round.cars[0].d + 300);
|
||||
// A rival only spawns on plain road, and the road is generated at random: a crack or a bridge can
|
||||
// sit at the first spot tried, so try further along until one takes. The rival is moved anyway.
|
||||
let car = null;
|
||||
for (let at = round.cars[0].d + 300; !car && at < round.cars[0].d + 3000; at += 40) car = bounce.spawnRival(round, kind, steady, at);
|
||||
assert.ok(car, `a ${kind} spawns`);
|
||||
Object.assign(car, { x, d, v: 0, tv: 0, vx: 0, kx: 0, air: 0, tx: x, lane: x, hopIn: 1e9, dropIn: 1e9, mode: "calm", ...over });
|
||||
return car;
|
||||
|
||||
@@ -370,6 +370,9 @@ test("framed, an Activities game in full screen asks the app for the whole scree
|
||||
await s.page.keyboard.press("f");
|
||||
await s.page.keyboard.press("Escape");
|
||||
assert.deepEqual(await told(), [true, false, true, false], "F and Esc each give it back");
|
||||
// The focus comes back to the board a moment after leaving full screen: an F pressed before
|
||||
// that goes nowhere (seen on slow runners).
|
||||
await s.page.waitForFunction(() => document.activeElement && document.activeElement.id === "activities-board");
|
||||
await s.page.keyboard.press("f");
|
||||
s.post({ items: [{ id: "q2", kind: "text", title: "Who uses it", body: "Who opens the export?" }], agent: { status: "waiting" } });
|
||||
// Wait for both new messages: the list already ends in false, so checking only its last item passed at once.
|
||||
|
||||
Reference in new issue
Block a user