v0.4.9h — a leg that is part of the row, the deck the sheet prints, and regions not miles per hour
The 0.4.9 line's port of v0.7.2, minus Gitea#18: the Division map redraw is a multiplayer redesign and does not belong in a build people are mid-playtest on. Gitea#17 — a 45° leg is an end of the west-to-east row, so backing into a cut through a curve's south leg no longer couples it back to front, and a crew pulling out through a leg takes its own cut with it. Gitea#14 — every count is docs/Deck cards5.xlsx, including removing the Q12 office doubling and the Gap 12 industry tripling. Gitea#15 — RAR reversed it: the placement is legal; what must hold is that no train crosses the gap. Gitea#3 — the printed speeds are scenery. One Stage per printed region, and where a train starts is what varies.
This commit is contained in:
+58
-10
@@ -907,17 +907,29 @@ describe('the page explains itself', () => {
|
||||
// A played card becomes a cell with a name on it — "turnout", "Freight House", "waiting area" —
|
||||
// and the explanation that was visible while it sat in hand disappears exactly when it starts
|
||||
// mattering. Play a long way in so every card kind reaches the grid.
|
||||
const game = newGame(111);
|
||||
for (let i = 0; i < 400; i++) {
|
||||
if (currentActor(game) === null) break;
|
||||
const { options } = actionGroups(game);
|
||||
if (options.length === 0) break;
|
||||
const pick = options.find((o) => o.type === 'card.play' && o.placement) ?? options[0]!;
|
||||
if (!submit(game, pick)) break;
|
||||
/**
|
||||
* THE SEED IS SEARCHED FOR, not written down. This took seed 111 flat and asserted its board
|
||||
* ended up with more than four cards on it. Gitea#3 changed how fast trains cross, which changes
|
||||
* how a game unfolds, and 111 stopped building enough of a district — so the test failed on its
|
||||
* own precondition rather than on anything about tooltips.
|
||||
*
|
||||
* It needs A well-built board, not one particular one, so it takes the first seed that gives it.
|
||||
*/
|
||||
let game = newGame(111);
|
||||
for (let seed = 111; seed < 211; seed++) {
|
||||
game = newGame(seed);
|
||||
for (let i = 0; i < 400; i++) {
|
||||
if (currentActor(game) === null) break;
|
||||
const { options } = actionGroups(game);
|
||||
if (options.length === 0) break;
|
||||
const pick = options.find((o) => o.type === 'card.play' && o.placement) ?? options[0]!;
|
||||
if (!submit(game, pick)) break;
|
||||
}
|
||||
if (view(game).cells.length > 4) break;
|
||||
}
|
||||
|
||||
const cells = view(game).cells;
|
||||
assert.ok(cells.length > 4, 'not enough of the board was built to be a real check');
|
||||
assert.ok(cells.length > 4, 'no seed under 211 built enough of a board to be a real check');
|
||||
for (const c of cells) {
|
||||
assert.ok(c.what.length > 0, `(${c.row},${c.col}) ${c.label} has no explanation`);
|
||||
// camelCase on the board is the failure that keeps recurring — labels AND descriptions.
|
||||
@@ -1534,7 +1546,40 @@ describe('the static build', () => {
|
||||
(target['onclick'] as (() => void) | null)?.();
|
||||
return true;
|
||||
};
|
||||
assert.ok(clickVerb(hand, 'play'), 'no card in hand offers a play verb');
|
||||
/**
|
||||
* TRY EVERY PLAY BUTTON, NOT JUST THE FIRST — a card offering "play" does not necessarily play
|
||||
* ONTO THE BOARD.
|
||||
*
|
||||
* This clicked the first play verb it found and then asserted the board had lit up. A train card
|
||||
* plays to the timetable and a Department discard to the piles, so neither lights a square, and
|
||||
* whether the first playable card in this deal happens to be a track or facility card is luck.
|
||||
* Gitea#14's deck counts re-dealt seed 555, the first play verb landed on Train 2, and the test
|
||||
* failed claiming the page highlighted nothing — when the page was right and the card simply had
|
||||
* no square to point at.
|
||||
*
|
||||
* So it clicks each play button in turn until the board lights, which is the property the test
|
||||
* is named for. It still fails loudly if NO card in hand can light a square.
|
||||
*
|
||||
* EACH BUTTON IS CLICKED EXACTLY ONCE. Picking a card is a toggle, so clicking one to check it
|
||||
* and then clicking it again inside the loop would UNPICK it — which is how the first draft of
|
||||
* this managed to fail on a deal whose very first play card was a good one.
|
||||
*/
|
||||
const playButtons = (el: Record<string, unknown>): Record<string, unknown>[] => {
|
||||
const fn = el['querySelectorAll'] as (s: string) => Record<string, unknown>[];
|
||||
return fn
|
||||
.call(el, 'button.cardact')
|
||||
.filter((n) => (n['dataset'] as Record<string, string>)['verb'] === 'play');
|
||||
};
|
||||
assert.ok(playButtons(hand).length > 0, 'no card in hand offers a play verb');
|
||||
let litTheBoard = false;
|
||||
for (const target of playButtons(hand)) {
|
||||
(target['onclick'] as (() => void) | null)?.();
|
||||
const drawn = String(grid['innerHTML']);
|
||||
if ((grid['highlighted'] as () => unknown[])().length > 0 || /data-ghost="/.test(drawn)) {
|
||||
litTheBoard = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Without the board stylesheet every shape is drawn black on a near-black background: the page
|
||||
// looks empty even though the markup is perfect.
|
||||
@@ -1547,7 +1592,10 @@ describe('the static build', () => {
|
||||
assert.match(html, /data-cell="/, 'the board drew no addressable cards');
|
||||
const lit = (grid['highlighted'] as () => unknown[])();
|
||||
const ghosts = /data-ghost="/.test(html);
|
||||
assert.ok(lit.length > 0 || ghosts, 'picking a card highlighted nothing on the board');
|
||||
assert.ok(
|
||||
litTheBoard || lit.length > 0 || ghosts,
|
||||
'no card in hand, picked in turn, ever highlighted a square on the board',
|
||||
);
|
||||
|
||||
/**
|
||||
* POINTING AT THE SQUARE A BUTTON MEANS — wired on the emitted bundle, not asserted off the menu.
|
||||
|
||||
Reference in New Issue
Block a user