test: follow formatted shell owners and make playback keyboard focus explicit

This commit is contained in:
Sameh Khamis committed 2026-09-13 04:49:02 -07:00
1 parent 945a809994
commit 841da87ca4
13 files changed
+90 -83

No files matched your search

+9 -8
View File
@@ -1,3 +1,4 @@
import { StyleManager } from './ui/applicationShell.js';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
@@ -24,7 +25,7 @@ test('the ACTIVE STYLE indicator is written from the style name and nothing else
assert.equal(writes.length, 1, 'the style indicator must have exactly one writer');
assert.match(
ui.slice(writes[0].index, writes[0].index + 160),
/this\._styleIndicator\.textContent = displayNames\[styleName\] \|\| styleName\.toUpperCase\(\);/,
/this\._styleIndicator\.textContent =\s*displayNames\[styleName\] \|\| styleName\.toUpperCase\(\);/,
);
const handler = locationSearchHandler();
@@ -66,15 +67,15 @@ test('any other camera destination clears the search label too', () => {
// Voice navigation, the globe reset, camera takeover and entity selection
// all funnel through _stampNavigation; without a clear there, a searched
// label outlives the place it named.
const start = ui.indexOf(' _stampNavigation({ cancelPendingSelection = true, clearSearchedLocation = true } = {}) {');
const start = ui.indexOf(' _stampNavigation(');
assert.ok(start > 0, '_stampNavigation is missing');
assert.match(ui.slice(start, start + 700), /if \(clearSearchedLocation\) this\.clearSearchedLocation\(\);/);
assert.match(StyleManager.prototype._stampNavigation.toString(), /if \(clearSearchedLocation\) this\.clearSearchedLocation\(\);/);
// The shared funnel is what the reset and voice seams actually reach.
for (const seam of ['resetToGlobeView() {', 'beginLocationNavigation() {', '_runExplicitNavigation(noun, navigate']) {
for (const seam of ['resetToGlobeView() {', 'beginLocationNavigation() {', '_runExplicitNavigation(']) {
const at = ui.indexOf(seam);
assert.ok(at > 0, `missing navigation seam "${seam}"`);
assert.match(ui.slice(at, at + 900), /_stampNavigation\(/, `"${seam}" must stamp navigation`);
assert.match(StyleManager.prototype[seam.match(/^(\w+)/)[1]].toString(), /_stampNavigation\(/, `"${seam}" must stamp navigation`);
}
// Public seam, so a camera owner that flies on its own can invalidate it.
@@ -86,11 +87,11 @@ test('a deferred lookup that never flies leaves the readout standing', () => {
// the stamp blanked a still-true readout whenever the lookup failed, was
// superseded, or was refused — no camera ever moved. The deferred begin opts
// out; the reassert seam, reached only once the flight is granted, clears.
const begin = ui.indexOf(' _beginDeferredNavigation(noun = ');
const begin = ui.indexOf(' _beginDeferredNavigation(');
assert.ok(begin > 0, '_beginDeferredNavigation is missing');
assert.match(
ui.slice(begin, begin + 700),
/stamp: \(\) => this\._stampNavigation\(\{ cancelPendingSelection, clearSearchedLocation: false \}\)/,
StyleManager.prototype._beginDeferredNavigation.toString(),
/stamp: \(\) =>\s*this\._stampNavigation\(\{\s*cancelPendingSelection,\s*clearSearchedLocation: false,?\s*\}\)/,
);
const reassert = ui.indexOf(' _reassertNavigationHandoff(generation) {');