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"/); }); });