mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
Pin the retired Operator code and test the live HUD fallback
qa-radio cycles Minimal, off, on, then Tactical, so the HUD toggle must restore a non-default layout, and expects that sequence instead of the removed Operator step. The share-link test pins the exact hudVariant codes, so dropping or moving operator's reserved code fails it. A live IntelHUD test checks that a retired Operator layout falls back to Tactical, and the Cyber test stub themes from the normalized value. The share-link table marks operator as retired, and the zh-CN glossary drops the removed string.
This commit is contained in:
1 parent
e693e665a6
commit
e12614a13a
6 files changed
+38
-8
No files matched your search
@@ -575,3 +575,25 @@ test('a summary interrupted while typing can retry unchanged context', async (t)
|
||||
env.restore();
|
||||
}
|
||||
});
|
||||
|
||||
// ── Retired layouts ─────────────────────────────────────────────────────────
|
||||
//
|
||||
// Share links keep the retired Operator code, so old links still name it. The
|
||||
// real HUD, not a caller, is what turns it into the default Tactical layout.
|
||||
|
||||
test('a retired Operator layout falls back to Tactical in the live HUD', () => {
|
||||
const env = installHudEnvironment();
|
||||
let hud;
|
||||
try {
|
||||
hud = new IntelHUD(env.viewer);
|
||||
hud._el = { dataset: {} };
|
||||
hud.setVariant('minimal');
|
||||
assert.equal(hud.getVariant(), 'minimal');
|
||||
hud.setVariant('operator');
|
||||
assert.equal(hud.getVariant(), 'tactical');
|
||||
assert.equal(hud._el.dataset.variant, 'tactical');
|
||||
} finally {
|
||||
hud?.destroy();
|
||||
env.restore();
|
||||
}
|
||||
});
|
||||
@@ -437,8 +437,14 @@ test('defaults travel as frozen meanings that match today’s app defaults', ()
|
||||
assert.equal(defaults.bloomIntensity, BLOOM_INTENSITY_DEFAULT);
|
||||
assert.equal(defaults.bloomVersion, BLOOM_SCALE_VERSION);
|
||||
assert.equal(defaults.hudVariant, HUD_LAYOUTS[0]);
|
||||
// Codes are append-only: the retired Operator layout keeps its code so old
|
||||
// Codes are append-only: the retired Operator layout keeps code 1 so old
|
||||
// links still parse, and the app restores them as Tactical.
|
||||
assert.deepEqual(SHARE_VIEW_ENUMS.hudVariant, [
|
||||
'tactical',
|
||||
'operator',
|
||||
'minimal',
|
||||
'cyber',
|
||||
]);
|
||||
assert.deepEqual(
|
||||
SHARE_VIEW_ENUMS.hudVariant.filter((variant) => variant !== 'operator'),
|
||||
[...HUD_LAYOUTS],
|
||||
|
||||
@@ -56,7 +56,7 @@ function styleOwner(t, initialVariant = 'cyber') {
|
||||
setVariant: (value) => {
|
||||
// Normalize like the real HUD so retired layouts fall back.
|
||||
variant = normalizeHudLayout(value);
|
||||
applyHudUiTheme(root, value);
|
||||
applyHudUiTheme(root, variant);
|
||||
},
|
||||
setMode: (value) => calls.push(['mode', value]),
|
||||
onStyleChange: (value) => calls.push(['style', value]),
|
||||
|
||||
Reference in new issue
Block a user