diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-17 14:32:37 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-17 14:32:37 +0800 |
| commit | 5c0ba37eda80d39e6ceca59bb1d5f4942f858995 (patch) | |
| tree | 948723f9cedf7ccb0707fa6ee516bd30fe20fd10 /frontend/src/lib/wizardError.test.ts | |
| download | strategy-lab-5c0ba37eda80d39e6ceca59bb1d5f4942f858995.tar.gz | |
chore: establish Strategy Lab source baseline (development, not release)
Diffstat (limited to 'frontend/src/lib/wizardError.test.ts')
| -rw-r--r-- | frontend/src/lib/wizardError.test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/src/lib/wizardError.test.ts b/frontend/src/lib/wizardError.test.ts new file mode 100644 index 0000000..43a6bb0 --- /dev/null +++ b/frontend/src/lib/wizardError.test.ts @@ -0,0 +1,18 @@ +import { describe, expect, it } from 'vitest'; +// Live browser QA regression: a failing dataset submit (e.g. HTTP422/500 from +// the backend) was captured into `submitErr` but never rendered, so the user +// saw silently nothing. The wizard markup must surface submitErr. +// Type support comes from vite/client's `*?raw` module declaration. +import wizardSource from '../components/DatasetWizard.svelte?raw'; + +describe('dataset wizard visible submit errors', () => { + it('renders backend submit failures (submitErr in template, not script-only)', () => { + const src: string = wizardSource as unknown as string; + // captured at least once + expect(src).toMatch(/submitErr = extractStatusMessage\(e\)/); + // and rendered outside the script: a template reference (Svelte template) + const template = src.slice(src.indexOf('/script') + 7); + expect(template).toMatch(/\{submitErr\}/); + expect(template).toMatch(/role="alert"/); + }); +}); |
