import { describe, expect, it } from 'vitest' import { describeTimelineEntry } from './labels' const entry = (action: string, changes: Record | null = null) => ({ id: 1, at: '', actor: null, action, changes }) describe('describeTimelineEntry', () => { it('describes workflow events in plain language', () => { expect(describeTimelineEntry(entry('create'))).toBe('reported the incident') expect(describeTimelineEntry(entry('status', { status: ['triage', 'investigation'] }))).toBe('moved it from Triage to Investigation') expect(describeTimelineEntry(entry('update', { severity: ['high', 'low'], locationDetail: [null, 'Dock'] }))).toBe('edited the severity, location') expect(describeTimelineEntry(entry('action.update', { actionId: 'x', title: 'Fix guard', status: ['open', 'done'] }))).toBe('marked “Fix guard” done') expect(describeTimelineEntry(entry('attachment.add', { fileName: 'spill.jpg' }))).toBe('attached spill.jpg') }) })