- Add permissions logic for status options in corrective actions. - Create tests for permissions functionality. - Implement queries for user authentication and actions management. - Develop Actions page to display and manage corrective actions. - Create authentication pages for login, setup, and password reset. - Add IncidentDetail page to view incident details and associated actions. - Implement Settings page for user management and password changes.
15 lines
982 B
TypeScript
15 lines
982 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { describeTimelineEntry } from './labels'
|
|
|
|
const entry = (action: string, changes: Record<string, unknown> | 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')
|
|
})
|
|
})
|