statusLabel() was a one-line alias for formatDocumentStatus() with no additional behaviour. Remove it and update DocumentStatusChip.svelte to call formatDocumentStatus() directly. Remove the corresponding alias test suite from the spec file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { formatDocumentStatus, statusDotClass } 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');
|
|
});
|
|
});
|