import { it, expect, vi } from 'vitest' import { qaCellValue } from './qaOps' import type { QARecord } from './qaOps' it('formats Beijing timestamps identically without constructing per-row locale formatting work', () => { const record = { asked_at: '2026-10-19T12:11:22Z' } as QARecord const expected = new Date(record.asked_at).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai', hour12: false }) const spy = vi.spyOn(Date.prototype, 'toLocaleString') try { for (let i = 0; i < 200; i++) expect(qaCellValue(record, 'asked_at')).toBe(expected) expect(spy).not.toHaveBeenCalled() } finally { spy.mockRestore() } })