mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-07 03:22:17 -08:00
Overlay 2.0 (#12)
This commit is contained in:
34
src/renderer/overlay-legacy-cleanup.test.ts
Normal file
34
src/renderer/overlay-legacy-cleanup.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
function readWorkspaceFile(relativePath: string): string {
|
||||
return fs.readFileSync(path.join(process.cwd(), relativePath), 'utf8');
|
||||
}
|
||||
|
||||
test('keyboard chord map no longer emits legacy invisible overlay script messages', () => {
|
||||
const keyboardSource = readWorkspaceFile('src/renderer/handlers/keyboard.ts');
|
||||
assert.doesNotMatch(keyboardSource, /subminer-toggle-invisible/);
|
||||
assert.doesNotMatch(keyboardSource, /subminer-show-invisible/);
|
||||
assert.doesNotMatch(keyboardSource, /subminer-hide-invisible/);
|
||||
});
|
||||
|
||||
test('overlay layer contracts no longer advertise invisible renderer layer', () => {
|
||||
const typesSource = readWorkspaceFile('src/types.ts');
|
||||
assert.doesNotMatch(typesSource, /export type OverlayLayer = 'visible' \| 'invisible'/);
|
||||
assert.doesNotMatch(
|
||||
typesSource,
|
||||
/getOverlayLayer:\s*\(\)\s*=>\s*'visible'\s*\|\s*'invisible'\s*\|\s*'modal'\s*\|\s*null/,
|
||||
);
|
||||
});
|
||||
|
||||
test('renderer stylesheet no longer contains invisible-layer selectors', () => {
|
||||
const cssSource = readWorkspaceFile('src/renderer/style.css');
|
||||
assert.doesNotMatch(cssSource, /body\.layer-invisible/);
|
||||
});
|
||||
|
||||
test('top-level docs avoid stale overlay-layers wording', () => {
|
||||
const docsReadmeSource = readWorkspaceFile('docs/README.md');
|
||||
assert.doesNotMatch(docsReadmeSource, /overlay layers/i);
|
||||
});
|
||||
Reference in New Issue
Block a user