diff --git a/src/react-components/tests/translations.spec.ts b/src/react-components/tests/translations.spec.ts index 541dfb8a1..80f46f0d2 100644 --- a/src/react-components/tests/translations.spec.ts +++ b/src/react-components/tests/translations.spec.ts @@ -4,30 +4,15 @@ import { expect, test as base } from "@playwright/experimental-ct-react" import * as supportedLanguages from "../../locales" -type Language = { - [K in keyof typeof supportedLanguages.en]: string -} - -type SupportedLanguages = { - [k in keyof typeof supportedLanguages]: Language -} - type TemplateStrings = { [k in keyof typeof supportedLanguages.en]: string[] } const test = base.extend<{ - en: Language - translations: SupportedLanguages templates: Partial }>({ - en: async ({}, use) => { - await use(supportedLanguages.en) - }, - translations: async ({}, use) => { - await use(supportedLanguages) - }, - templates: async ({ en }, use) => { + templates: async ({}, use) => { + const en = supportedLanguages.en const templates: Partial = {} for (const [key, value] of Object.entries(en)) { const matches = value.match(/\{.+?}/g) @@ -40,11 +25,14 @@ const test = base.extend<{ }, }) -test("language keys and templates match", async ({ - en, - translations, - templates, -}) => { +test("language keys and templates match", async ({ templates }) => { + const translations = supportedLanguages + const en = supportedLanguages.en + console.log("XXXXXXXXXX") + console.log(en) + console.log("XXXXXXXXXX") + console.log(translations) + console.log("XXXXXXXXXX") await test.step("Checking language keys", () => { for (const translation of Object.values(translations)) { expect(Object.keys(translation).sort()).toEqual(Object.keys(en).sort())