These functions describe DocumentStatus display logic (dot colours, readable labels) and belong in the document domain. They were incorrectly placed in personFormat.ts. Moving them to documentStatusLabel.ts removes the person → document dependency and prepares the codebase for the boundaries/dependencies ESLint rule. Refs #410 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
73 lines
2.0 KiB
TypeScript
73 lines
2.0 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { formatDocumentStatus, statusDotClass, statusLabel } 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');
|
|
});
|
|
});
|
|
|
|
describe('statusDotClass', () => {
|
|
it('PLACEHOLDER → bg-gray-400', () => {
|
|
expect(statusDotClass('PLACEHOLDER')).toBe('bg-gray-400');
|
|
});
|
|
|
|
it('UPLOADED → bg-emerald-500', () => {
|
|
expect(statusDotClass('UPLOADED')).toBe('bg-emerald-500');
|
|
});
|
|
|
|
it('TRANSCRIBED → bg-blue-400', () => {
|
|
expect(statusDotClass('TRANSCRIBED')).toBe('bg-blue-400');
|
|
});
|
|
|
|
it('REVIEWED → bg-amber-400', () => {
|
|
expect(statusDotClass('REVIEWED')).toBe('bg-amber-400');
|
|
});
|
|
|
|
it('ARCHIVED → bg-emerald-600', () => {
|
|
expect(statusDotClass('ARCHIVED')).toBe('bg-emerald-600');
|
|
});
|
|
});
|
|
|
|
describe('statusLabel', () => {
|
|
it('PLACEHOLDER → "Platzhalter"', () => {
|
|
expect(statusLabel('PLACEHOLDER')).toBe('Platzhalter');
|
|
});
|
|
|
|
it('UPLOADED → "Hochgeladen"', () => {
|
|
expect(statusLabel('UPLOADED')).toBe('Hochgeladen');
|
|
});
|
|
|
|
it('TRANSCRIBED → "Transkribiert"', () => {
|
|
expect(statusLabel('TRANSCRIBED')).toBe('Transkribiert');
|
|
});
|
|
|
|
it('REVIEWED → "Geprüft"', () => {
|
|
expect(statusLabel('REVIEWED')).toBe('Geprüft');
|
|
});
|
|
|
|
it('ARCHIVED → "Archiviert"', () => {
|
|
expect(statusLabel('ARCHIVED')).toBe('Archiviert');
|
|
});
|
|
});
|