Checkpoint of in-progress work: the registration wizard (address prefill, DUO diploma lookup, policy questions), decision-DTO contracts, parse-don't- validate value objects, infrastructure adapters, plus CLAUDE.md and the architecture/ADR docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
581 B
TypeScript
18 lines
581 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { parseEmail } from './email';
|
|
|
|
describe('parseEmail', () => {
|
|
it('accepts a well-formed address and trims it', () => {
|
|
const r = parseEmail(' naam@voorbeeld.nl ');
|
|
expect(r.ok).toBe(true);
|
|
if (r.ok) expect(r.value).toBe('naam@voorbeeld.nl');
|
|
});
|
|
|
|
it('rejects malformed addresses', () => {
|
|
expect(parseEmail('').ok).toBe(false);
|
|
expect(parseEmail('naam').ok).toBe(false);
|
|
expect(parseEmail('naam@voorbeeld').ok).toBe(false);
|
|
expect(parseEmail('naam @voorbeeld.nl').ok).toBe(false);
|
|
});
|
|
});
|