23 lines
677 B
TypeScript
23 lines
677 B
TypeScript
import { describe, expect, test } from 'vitest'
|
|
import { formatEveDate, formatIsk } from './formaters'
|
|
|
|
describe('formatIsk', () => {
|
|
test('Formats ISK correctly', () => {
|
|
expect(formatIsk(123456789)).toBe('123.456.789,00 ISK')
|
|
})
|
|
})
|
|
|
|
describe('formatEveDate', () => {
|
|
test('Formats EVE date correctly', () => {
|
|
const date = new Date(Date.UTC(2022, 0, 1, 0, 0))
|
|
expect(formatEveDate(date)).toBe('2022.01.01 00:00')
|
|
})
|
|
|
|
test('Returns empty string for undefined date', () => {
|
|
expect(formatEveDate()).toBe('')
|
|
})
|
|
|
|
test('Returns empty string for null date', () => {
|
|
expect(formatEveDate(null)).toBe('')
|
|
})
|
|
}) |