import { it, expect } from 'vitest' import { parseQAUsage } from './qaUsage' it('keeps custom region usage instead of rejecting or silently dropping its counts', () => { const wire = { organization: { state: 'ready', directory_id: 'd', directory_source: 'weekly_report_live', synced_at: '2026-10-17T00:00:00Z', revision_id: 'r', basis: 'current_directory', region_names: ['国内教育'], }, as_of: '2026-10-17T01:00:00Z', start: '2026-10-16T00:00:00Z', end: '2026-10-17T00:00:00Z', keyword: '', questions: 2, identified_users: 1, rows: [{ key: '国内教育', questions: 2, succeeded: 1, failed: 1, other: 0, users: 1, roster_people: 2 }], } expect(parseQAUsage(wire).rows[0].key).toBe('国内教育') expect(() => parseQAUsage({ ...wire, organization: { ...wire.organization, region_names: ['其他'] } })).toThrow() })