- 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.
13 lines
435 B
TypeScript
13 lines
435 B
TypeScript
import { describe, expect, it } from 'vitest'
|
||
import { toCsv } from './csv.ts'
|
||
|
||
describe('toCsv', () => {
|
||
it('quotes commas, quotes and newlines', () => {
|
||
expect(toCsv(['a', 'b'], [['x,y', 'say "hi"\nok']])).toBe('a,b\r\n"x,y","say ""hi""\nok"\r\n')
|
||
})
|
||
|
||
it('neutralises formula prefixes and blanks nulls', () => {
|
||
expect(toCsv(['a'], [['=1+1'], ['-2'], [null], [3]])).toBe("a\r\n'=1+1\r\n'-2\r\n\r\n3\r\n")
|
||
})
|
||
})
|