From 5c0ba37eda80d39e6ceca59bb1d5f4942f858995 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Thu, 17 Sep 2026 14:32:37 +0800 Subject: chore: establish Strategy Lab source baseline (development, not release) --- frontend/src/lib/wizardError.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 frontend/src/lib/wizardError.test.ts (limited to 'frontend/src/lib/wizardError.test.ts') 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"/); + }); +}); -- cgit v1.2.3