Files
atomic-design-poc/src/app/registratie/domain/value-objects/email.spec.ts
Edwin van den Houdt 64385999eb Add registratie wizard, BFF dashboard-view, contracts/value-objects, and architecture docs
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>
2026-06-26 17:23:52 +02:00

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