Files
familienarchiv/frontend/src/lib/utils/documentStatusLabel.spec.ts
Marcel 3abdf9bb68 feat(persons): add formatLifeDateRange + formatDocumentStatus utility functions
Unit tests for both; i18n keys for doc status and person stats bar;
PERSON_NOT_FOUND added to frontend ErrorCode type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 19:50:30 +02:00

29 lines
868 B
TypeScript

import { describe, it, expect } from 'vitest';
import { formatDocumentStatus } from './documentStatusLabel';
describe('formatDocumentStatus', () => {
it('maps PLACEHOLDER to correct label', () => {
expect(formatDocumentStatus('PLACEHOLDER')).toBe('Platzhalter');
});
it('maps UPLOADED to correct label', () => {
expect(formatDocumentStatus('UPLOADED')).toBe('Hochgeladen');
});
it('maps TRANSCRIBED to correct label', () => {
expect(formatDocumentStatus('TRANSCRIBED')).toBe('Transkribiert');
});
it('maps REVIEWED to correct label', () => {
expect(formatDocumentStatus('REVIEWED')).toBe('Geprüft');
});
it('maps ARCHIVED to correct label', () => {
expect(formatDocumentStatus('ARCHIVED')).toBe('Archiviert');
});
it('returns fallback for unknown status', () => {
expect(formatDocumentStatus('SOMETHING_NEW')).toBe('Unbekannt');
});
});