Update shipyard integration assertions

This commit is contained in:
Admin 2026-09-20 21:34:35 +00:00
parent 9a8e0d4a00
commit 8cd5950d14

View File

@ -298,7 +298,7 @@ test('shipyard overlay uses supplied component art and explicit module purchases
assert.match(shipyard, /shipyard-ui\/ship_preview\.png\?url/);
assert.match(shipyard, /shipyard-ui\/upgrades\.png\?url/);
assert.match(shipyard, /airship:shipyard-open/);
assert.match(shipyard, /action: 'purchase-module'/);
assert.match(shipyard, /dispatchAction\('purchase-module', \{ moduleId \}\)/);
assert.match(game, /marketForPort\(port\)/);
assert.match(game, /airship:shipyard-state/);
assert.match(game, /this\.shipyardOpen = true/);
@ -387,13 +387,14 @@ test('dense clouds conceal ships and suppress long-range pirate fire', async ()
assert.match(source, /concealment: this\.player\?\.getData\?\.\('cloudConcealment'\) \|\| 0/);
});
test('mobile HUD skips hidden Phaser rendering and throttles DOM state publishing', async () => {
test('HUD skips hidden Phaser rendering while DOM state remains available to overlays', async () => {
const source = await read('src/game-v4.js');
assert.match(source, /const HUD_PUBLISH_INTERVAL_MS = 50/);
assert.match(source, /if \(!this\.mobileHudActive\) this\.drawHud\(hudState\)/);
assert.match(source, /publishHudState\(state = this\.buildHudState\(\), force = false\)/);
assert.match(source, /if \(!this\.mobileHudActive \|\| !state\) return/);
assert.match(source, /if \(!state\) return/);
assert.match(source, /if \(this\.mobileHudActive && !force && now - this\.lastHudPublishAt < HUD_PUBLISH_INTERVAL_MS\) return/);
assert.match(source, /now - this\.lastHudPublishAt < HUD_PUBLISH_INTERVAL_MS/);
assert.match(source, /drawHud\(state = this\.buildHudState\(\)\)/);
});