diff --git a/xbox/live/tests/hello.test.mjs b/xbox/live/tests/hello.test.mjs index e42097cbb..1be91e9c4 100644 --- a/xbox/live/tests/hello.test.mjs +++ b/xbox/live/tests/hello.test.mjs @@ -586,12 +586,18 @@ test("debug view renders on the foreground triangle layer", () => { // halfway and drew nothing, which is exactly how this test failed once. So // say what the layer is: the scene projects inside ±1.4 and the band in // front of it is reserved for overlays. Every face debug adds lands there, - // none of the plain frame's do, and the scene underneath is untouched. + // none of the plain frame's do, and the scene underneath is untouched — + // apart from the bug, which is a HUD status icon beside the MIDI piano now + // and so draws in the HUD's lane rather than on the overlay band. const inFront = (frame) => frame.filter(([, , z]) => z < -1.4); + const behind = (frame) => frame.length - inFront(frame).length; assert.equal(fight.clientErrorState(), ""); assert.equal(inFront(plain).length, 0); assert.ok(inFront(debug).length > 100); - assert.equal(debug.length - inFront(debug).length, plain.length); + const strays = behind(debug) - plain.length; + assert.ok(strays > 0 && strays < 40, + `debug added ${strays} faces behind the overlay; only the status-lane bug belongs there`); + assert.match(source, /if \(debugHitboxes\) icons\.push\("bug"\)/); assert.match(source, /let debugHitboxes = false/); assert.match(source, /function drawCornerCrops[\s\S]*?filledCapsule/); assert.match(source, @@ -1018,25 +1024,31 @@ test("ambient air is a simulated world-entity field", () => { test("debug HUD shows FPS without repeating oskiewar beside the round QR", () => { assert.match(source, /Math\.round\(displayFps \|\| 0\) \+ " fps"/); - assert.match(source, - /if \(debugHitboxes\) \{\n drawDebugBug\(safe\);\n const fpsLabel/); + assert.match(source, /if \(debugHitboxes\) \{[\s\S]{0,140}const fpsLabel/); assert.match(source, /typeWrite\(fpsLabel, safe\.left \+ 2, safe\.top \+ 2/); assert.doesNotMatch(source, /const gameLabel = "oskiewar"/); }); -test("debug starts hidden and parks its persistent bug at bottom center", () => { +// The bug used to be parked on its own at bottom center. It is a status icon +// now, sharing the HUD's top-right lane with the MIDI piano, so it is placed +// by the tray rather than by a corner of its own. +test("debug starts hidden and shows its bug in the HUD status lane", () => { assert.match(source, /let debugHitboxes = false/); - assert.match(source, /function drawDebugBug\(safe\)/); - assert.match(source, /if \(debugHitboxes\) \{\n drawDebugBug\(safe\)/); - assert.match(source, /const x = viewCenterX\(\)/); - assert.match(source, /const y = safe\.bottom - 18/); + assert.match(source, /function drawDebugBug\(x, y\)/); + assert.match(source, /if \(debugHitboxes\) icons\.push\("bug"\)/); + assert.match(source, + /if \(name === "midi"\) drawStatusPiano\(x, y, lit\);\n\s*else drawDebugBug\(x, y \+ 2\)/); + assert.doesNotMatch(source, /const y = safe\.bottom - 18/); }); test("web title offers the shared account logout without entering a fight", () => { assert.match(webShell, /