CI / changes (pull_request) Successful in 15s
CI / lint (pull_request) Successful in 57s
CI / frontend (pull_request) Successful in 2m36s
CI / storybook-a11y (pull_request) Failing after 3m14s
CI / backend (pull_request) Successful in 2m1s
CI / semgrep (pull_request) Successful in 1m10s
CI / e2e (pull_request) Successful in 3m3s
CI / api-client-drift (pull_request) Successful in 2m1s
New GET /werkvoorraad endpoint lists aanvragen still open (Ingediend/InBehandeling), gated by the medewerker capability (CanBeoordelen) rather than the admin role — reuses the existing ApplicationSummaryDto, no new DTO. GET /me now surfaces aanvraag:beoordelen for a behandelaar so the FE can gate with the same AccessStore/capabilityGuard idiom every other page uses. FE: a behandeling domain type deliberately narrower than ssp's full AanvraagStatus union (only the two open tags — illegal states unrepresentable), composed into a werkvoorraad-list organism from existing shared/ui molecules. Replaces WP-61's scaffold placeholder as the app's real landing page. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { werkvoorraadRow, statusLabel, TYPE_LABELS } from './werkvoorraad-item-view';
|
|
import { WerkvoorraadItem } from './werkvoorraad-item';
|
|
|
|
const base: Omit<WerkvoorraadItem, 'status'> = {
|
|
id: '1',
|
|
type: 'herregistratie',
|
|
owner: '111222333',
|
|
submittedAt: '2024-05-12',
|
|
};
|
|
|
|
describe('werkvoorraadRow', () => {
|
|
it('heading is the type, subtitle carries the owner BSN', () => {
|
|
const row = werkvoorraadRow({
|
|
...base,
|
|
status: { tag: 'InBehandeling', referentie: 'R1', manual: false },
|
|
});
|
|
expect(row.heading).toBe(TYPE_LABELS.herregistratie);
|
|
expect(row.subtitle).toContain('111222333');
|
|
});
|
|
|
|
it('status line carries the status label, reference and submit date', () => {
|
|
const row = werkvoorraadRow({
|
|
...base,
|
|
status: { tag: 'InBehandeling', referentie: 'R1', manual: false },
|
|
});
|
|
expect(row.status).toContain(
|
|
statusLabel({ tag: 'InBehandeling', referentie: 'R1', manual: false }),
|
|
);
|
|
expect(row.status).toContain('R1');
|
|
expect(row.status).toContain('12 mei 2024');
|
|
});
|
|
|
|
it('manual review is called out distinctly from an automatic InBehandeling', () => {
|
|
const manual = statusLabel({ tag: 'InBehandeling', referentie: 'R1', manual: true });
|
|
const auto = statusLabel({ tag: 'InBehandeling', referentie: 'R1', manual: false });
|
|
expect(manual).not.toBe(auto);
|
|
});
|
|
|
|
it('a missing submit date leaves no dangling separator', () => {
|
|
const row = werkvoorraadRow({
|
|
...base,
|
|
submittedAt: undefined,
|
|
status: { tag: 'Ingediend', referentie: 'R9' },
|
|
});
|
|
expect(row.status).toBe(`${statusLabel({ tag: 'Ingediend', referentie: 'R9' })} · R9`);
|
|
});
|
|
});
|