mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-20 09:09:35 +02:00
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:
1 parent
1c19641280
commit
c1fde8e639
3 files changed
+6
No files matched your search
@@ -40,6 +40,8 @@ function loadApp() {
|
|||||||
escapeHtml: (s: string) => String(s),
|
escapeHtml: (s: string) => String(s),
|
||||||
// Reverse-proxy route builder from constants.js (not loaded here); identity at root.
|
// Reverse-proxy route builder from constants.js (not loaded here); identity at root.
|
||||||
CodemanBase: { base: '', url: (p: string) => p },
|
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() },
|
document: { getElementById: () => null, addEventListener: vi.fn() },
|
||||||
window: windowStub,
|
window: windowStub,
|
||||||
setTimeout,
|
setTimeout,
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ function loadApp(media: FakeMedia[]) {
|
|||||||
escapeHtml: (s: string) => String(s),
|
escapeHtml: (s: string) => String(s),
|
||||||
// Reverse-proxy route builder from constants.js (not loaded here); identity at root.
|
// Reverse-proxy route builder from constants.js (not loaded here); identity at root.
|
||||||
CodemanBase: { base: '', url: (p: string) => p },
|
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() },
|
document: { getElementById: () => null, addEventListener: vi.fn() },
|
||||||
window: { addEventListener: vi.fn() },
|
window: { addEventListener: vi.fn() },
|
||||||
setTimeout,
|
setTimeout,
|
||||||
|
|||||||
@@ -594,6 +594,8 @@ describe('file-preview overlay spreadsheet wiring', () => {
|
|||||||
console,
|
console,
|
||||||
escapeHtml: (value: unknown) => String(value ?? ''),
|
escapeHtml: (value: unknown) => String(value ?? ''),
|
||||||
CodemanBase: { base: '', url: (p: string) => p },
|
CodemanBase: { base: '', url: (p: string) => p },
|
||||||
|
// From constants.js (not loaded here): a workbook never renders as an HTML page.
|
||||||
|
rendersAsPage: () => false,
|
||||||
fetch: fetchMock,
|
fetch: fetchMock,
|
||||||
setTimeout,
|
setTimeout,
|
||||||
clearTimeout,
|
clearTimeout,
|
||||||
|
|||||||
Reference in new issue
Block a user