summaryrefslogtreecommitdiff
path: root/frontend/src/lib/layout.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/lib/layout.test.ts')
-rw-r--r--frontend/src/lib/layout.test.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/src/lib/layout.test.ts b/frontend/src/lib/layout.test.ts
new file mode 100644
index 0000000..99d3c47
--- /dev/null
+++ b/frontend/src/lib/layout.test.ts
@@ -0,0 +1,18 @@
+import { describe, expect, it } from 'vitest';
+// `?raw` gives us the exact Svelte source for a real regression check
+// (ProjectPage used to wrap a second <Layout>, doubling the sidebar).
+// Type support comes from vite/client's `*?raw` module declaration.
+import projectPageSource from '../pages/ProjectPage.svelte?raw';
+
+describe('single layout shell', () => {
+ it('ProjectPage does not nest its own Layout', () => {
+ const src: string = projectPageSource as unknown as string;
+ expect(src).not.toMatch(/import\s+Layout/);
+ expect(src).not.toMatch(/<Layout/);
+ // page props still passed through on each tab
+ expect(src).toMatch(/ProjectDataTab/);
+ expect(src).toMatch(/ProjectStrategyTab/);
+ expect(src).toMatch(/ProjectBacktestTab/);
+ expect(src).toMatch(/ProjectResultsTab/);
+ });
+});