Files
SkinbaseNova/resources/js/lib/profileFormatters.test.js
T

17 lines
551 B
JavaScript

import { describe, expect, it } from 'vitest'
import { formatProfileDate, formatProfileNumber } from './profileFormatters'
describe('profile formatters', () => {
it('uses a stable en-US number format independent of the browser locale', () => {
expect(formatProfileNumber(9529106)).toBe('9,529,106')
})
it('uses UTC for stable calendar dates at timezone boundaries', () => {
expect(formatProfileDate('2024-01-01T00:30:00.000Z', {
month: 'long',
day: 'numeric',
year: 'numeric',
})).toBe('January 1, 2024')
})
})