test(file-preview): give the stubbed harnesses rendersAsPage()

Three suites load panels-ui.js without constants.js and stub the globals
it uses (escapeHtml, CodemanBase). openFilePreview() now asks
rendersAsPage() from constants.js, so those stubs need it too; none of
their files is an HTML page, so it answers false.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-13 17:23:25 +02:00
1 parent 1c19641280
commit c1fde8e639
3 files changed
+6

No files matched your search

+2
View File
@@ -40,6 +40,8 @@ function loadApp() {
escapeHtml: (s: string) => String(s),
// Reverse-proxy route builder from constants.js (not loaded here); identity at root.
CodemanBase: { base: '', url: (p: string) => p },
// Also from constants.js: no file in this suite renders as an HTML page.
rendersAsPage: () => false,
document: { getElementById: () => null, addEventListener: vi.fn() },
window: windowStub,
setTimeout,
+2
View File
@@ -66,6 +66,8 @@ function loadApp(media: FakeMedia[]) {
escapeHtml: (s: string) => String(s),
// Reverse-proxy route builder from constants.js (not loaded here); identity at root.
CodemanBase: { base: '', url: (p: string) => p },
// Also from constants.js: no file in this suite renders as an HTML page.
rendersAsPage: () => false,
document: { getElementById: () => null, addEventListener: vi.fn() },
window: { addEventListener: vi.fn() },
setTimeout,
+2
View File
@@ -594,6 +594,8 @@ describe('file-preview overlay spreadsheet wiring', () => {
console,
escapeHtml: (value: unknown) => String(value ?? ''),
CodemanBase: { base: '', url: (p: string) => p },
// From constants.js (not loaded here): a workbook never renders as an HTML page.
rendersAsPage: () => false,
fetch: fetchMock,
setTimeout,
clearTimeout,