mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
refactor: isolate Location controls and cancellable search
This commit is contained in:
1 parent
20c1611354
commit
ea77b49482
16 files changed
+604
-245
No files matched your search
@@ -44,11 +44,13 @@ test('a free-text search records its destination for the LOCATION mini-status',
|
||||
});
|
||||
|
||||
test('the mini-status reads its copy from the shared formatter', () => {
|
||||
assert.match(ui, /import \{ locationMiniStatus \} from '\.\/locationStatus\.js';/);
|
||||
const controls = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'locationControls.js'), 'utf8');
|
||||
assert.match(controls, /import \{ locationMiniStatus \} from '\.\.\/locationStatus\.js';/);
|
||||
assert.match(controls, /const lines = locationMiniStatus\(state\)/);
|
||||
const start = ui.indexOf(' _updateLocationMiniStatus() {');
|
||||
assert.ok(start > 0, '_updateLocationMiniStatus is missing');
|
||||
const body = ui.slice(start, ui.indexOf('\n }', start));
|
||||
assert.match(body, /locationMiniStatus\(\{[\s\S]*?searchedLabel: this\._searchedLocationLabel,[\s\S]*?\}\)/);
|
||||
assert.match(body, /_locationControls\?\.renderStatus\(\{[\s\S]*?searchedLabel: this\._searchedLocationLabel,[\s\S]*?\}\)/);
|
||||
// No second copy of the placeholder strings to drift out of sync.
|
||||
assert.doesNotMatch(body, /Location: --/);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user