Test wide-screen HUD responsiveness
This commit is contained in:
parent
ebeb5e0d1b
commit
3b8fe08d9e
@ -47,3 +47,22 @@ test('player collision callback queues hits and processing occurs in scene updat
|
|||||||
assert.match(source, /combat:player-hit-queued/);
|
assert.match(source, /combat:player-hit-queued/);
|
||||||
assert.match(source, /combat:player-hit-processed/);
|
assert.match(source, /combat:player-hit-processed/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('wide-screen HUD keeps visual controls aligned with touch hit-zones', async () => {
|
||||||
|
const source = await read('src/mobile-hud.js');
|
||||||
|
|
||||||
|
assert.match(source, /@media \(min-width: 700px\)/);
|
||||||
|
assert.match(source, /--steam-wide-helm-size:/);
|
||||||
|
assert.match(source, /--steam-wide-cannon-size:/);
|
||||||
|
assert.match(source, /\.steam-radar-wrap,\s*#mobile-controls\.controller-active #drag-stick/);
|
||||||
|
assert.match(source, /\.steam-cannon-port,\s*\.steam-cannon-starboard,\s*#mobile-controls\.controller-active \.mobile-control\.port,\s*#mobile-controls\.controller-active \.mobile-control\.starboard/);
|
||||||
|
assert.match(source, /right: calc\(var\(--steam-wide-edge-right\) \+ var\(--steam-wide-cannon-size\) \+ 14px\)/);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('wide-screen HUD caps portrait-scaled artwork instead of stretching with viewport width', async () => {
|
||||||
|
const source = await read('src/mobile-hud.js');
|
||||||
|
|
||||||
|
assert.match(source, /\.steam-top \{[\s\S]*?width: min\(64vw, 560px\)/);
|
||||||
|
assert.match(source, /\.steam-player-card \{[\s\S]*?width: min\(34vw, 360px\)/);
|
||||||
|
assert.match(source, /\.steam-enemy-card \{[\s\S]*?width: min\(30vw, 330px\)/);
|
||||||
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user