refactor(document): remove statusLabel() alias, use formatDocumentStatus directly
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 3m21s
CI / OCR Service Tests (pull_request) Successful in 29s
CI / Backend Unit Tests (pull_request) Failing after 3m1s
CI / Unit & Component Tests (push) Failing after 3m28s
CI / OCR Service Tests (push) Successful in 28s
CI / Backend Unit Tests (push) Failing after 3m3s

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>
This commit is contained in:
Marcel
2026-05-05 18:04:21 +02:00
parent 05a9e4ee47
commit 7a22c1faf2
3 changed files with 3 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { import {
formatDocumentStatus,
statusDotClass, statusDotClass,
statusLabel,
type DocumentStatus type DocumentStatus
} from '$lib/document/documentStatusLabel'; } from '$lib/document/documentStatusLabel';
@@ -12,7 +12,7 @@ type Props = {
let { status }: Props = $props(); let { status }: Props = $props();
const dotClass = $derived(statusDotClass(status)); const dotClass = $derived(statusDotClass(status));
const label = $derived(statusLabel(status)); const label = $derived(formatDocumentStatus(status));
</script> </script>
<span <span

View File

@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
import { formatDocumentStatus, statusDotClass, statusLabel } from './documentStatusLabel'; import { formatDocumentStatus, statusDotClass } from './documentStatusLabel';
describe('formatDocumentStatus', () => { describe('formatDocumentStatus', () => {
it('maps PLACEHOLDER to correct label', () => { it('maps PLACEHOLDER to correct label', () => {
@@ -48,25 +48,3 @@ describe('statusDotClass', () => {
expect(statusDotClass('ARCHIVED')).toBe('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');
});
});

View File

@@ -33,7 +33,3 @@ export function statusDotClass(status: DocumentStatus): string {
return 'bg-emerald-600'; return 'bg-emerald-600';
} }
} }
export function statusLabel(status: string): string {
return formatDocumentStatus(status);
}