- Implemented Form301 component for displaying OSHA Form 301 equivalent, including employee and case information. - Created Osha component to manage OSHA recordkeeping, including tabs for 300 Log, 300A Summary, Hours & rates, and Submit to OSHA. - Added functionality for printing and downloading CSV files for OSHA submissions. - Integrated loading and error handling states for data fetching.
13 lines
441 B
TypeScript
13 lines
441 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('\uFEFFa,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("\uFEFFa\r\n'=1+1\r\n'-2\r\n\r\n3\r\n")
|
|
})
|
|
})
|