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>
This commit is contained in:
28
frontend/src/lib/utils/documentStatusLabel.spec.ts
Normal file
28
frontend/src/lib/utils/documentStatusLabel.spec.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user