import { expect } from '@open-wc/testing' /** * The summary row tags a column with its accumulator's name - `label.accumulator_${type}`. * * max and min were swapped in all five locales: a column summed with `max` (Math.max) was tagged * "min" / 「최소」. The words are written out here per locale, so a swap in any one of them fails. */ const EXPECTED: Record = { en: { max: 'max', min: 'min' }, ko: { max: '최대', min: '최소' }, ja: { max: '最大', min: '最小' }, zh: { max: '最大', min: '最小' }, ms: { max: 'Maksimum', min: 'Minimum' } } async function translations(locale: string): Promise> { const response = await fetch(new URL(`../../translations/${locale}.json`, import.meta.url)) expect(response.ok, `${locale}.json is served`).to.equal(true) return response.json() } describe('accumulator labels', () => { for (const [locale, words] of Object.entries(EXPECTED)) { it(`${locale}: max is the largest, min the smallest`, async () => { const t = await translations(locale) expect(t['label.accumulator_max']).to.equal(words.max) expect(t['label.accumulator_min']).to.equal(words.min) }) } it('ko: count is 개수', async () => { expect((await translations('ko'))['label.accumulator_count']).to.equal('개수') }) })