test: cover full cathedral relay and CSS assets

This commit is contained in:
Hermes Agent
2026-07-28 09:24:22 +08:00
parent c53bc26d7d
commit 111501a57c
2 changed files with 18 additions and 0 deletions
+16
View File
@@ -11,6 +11,7 @@ import {
reset, reset,
validateLevel, validateLevel,
} from '../game-engine.js'; } from '../game-engine.js';
import { LEVELS } from '../levels.js';
const ONE_RELAY = [ const ONE_RELAY = [
'#########', '#########',
@@ -117,3 +118,18 @@ test('two independent echoes can sustain a staged two-gate extraction route', ()
assert.equal(state.status, 'won'); assert.equal(state.status, 'won');
assert.deepEqual(state.player, { x: 11, y: 1 }); assert.deepEqual(state.player, { x: 11, y: 1 });
}); });
test('three independent echoes sustain the cathedral-null extraction route end-to-end', () => {
const tripleRelay = LEVELS.find((level) => level.id === 'cathedral-null');
let state = createGame(tripleRelay.map, { maxEchoes: 3 });
state = anchor(drive(state, 'DDRRRRR'));
state = anchor(drive(state, 'DDDDRRRRR'));
state = anchor(drive(state, 'RRR'));
assert.deepEqual(getActiveGateIds(state), ['A', 'B', 'C']);
state = drive(state, 'RRRRRRRRRRRR');
assert.equal(state.status, 'won');
assert.deepEqual(state.player, { x: 13, y: 1 });
});
+2
View File
@@ -12,6 +12,8 @@ test('the playable shell uses a local canvas entry point and no external runtime
assert.match(html, /<script\s+type="module"\s+src="\.\/app\.js"><\/script>/); assert.match(html, /<script\s+type="module"\s+src="\.\/app\.js"><\/script>/);
assert.match(html, /data-action="anchor"/); assert.match(html, /data-action="anchor"/);
assert.doesNotMatch(html, /<(?:script|link|img)\b[^>]+(?:src|href)\s*=\s*["']https?:\/\//i); assert.doesNotMatch(html, /<(?:script|link|img)\b[^>]+(?:src|href)\s*=\s*["']https?:\/\//i);
assert.doesNotMatch(html, /@import\s+(?:url\()?\s*["']?https?:\/\//i);
assert.doesNotMatch(html, /url\(\s*["']?https?:\/\//i);
}); });
test('the runtime exposes a narrow smoke-test surface without network calls', () => { test('the runtime exposes a narrow smoke-test surface without network calls', () => {