diff --git a/src/components/PageComponents/Connect/HTTP.tsx b/src/components/PageComponents/Connect/HTTP.tsx index 0846a4b0..c7c6250f 100644 --- a/src/components/PageComponents/Connect/HTTP.tsx +++ b/src/components/PageComponents/Connect/HTTP.tsx @@ -81,12 +81,12 @@ export const HTTP = ( disabled={connectionInProgress} >
- {t("httpConnection.connectionFailedAlert.title")} + {t("httpConnection_connectionFailedAlert.title")}
- {t("httpConnection.connectionFailedAlert.descriptionPrefix")} + {t("httpConnection_connectionFailedAlert.descriptionPrefix")} {connectionError.secure && - t("httpConnection.connectionFailedAlert.httpsHint")} - {t("httpConnection.connectionFailedAlert.openLinkPrefix")} + t("httpConnection_connectionFailedAlert.httpsHint")} + {t("httpConnection_connectionFailedAlert.openLinkPrefix")} {`${ connectionError.secure - ? t("httpConnection.https") - : t("httpConnection.http") + ? t("httpConnection_https") + : t("httpConnection_http") }://${connectionError.host}`} {" "} - {t("httpConnection.connectionFailedAlert.openLinkSuffix")} + {t("httpConnection_connectionFailedAlert.openLinkSuffix")} {connectionError.secure ? t( - "httpConnection.connectionFailedAlert.acceptTlsWarningSuffix", + "httpConnection_connectionFailedAlert.acceptTlsWarningSuffix", ) : ""}.{" "} - {t("httpConnection.connectionFailedAlert.learnMoreLink")} + {t("httpConnection_connectionFailedAlert.learnMoreLink")}
{startNode?.user?.longName}
↓ {snr?.[0] ?? t("traceRoute_snrUnknown")} - {t("common.dbUnit")} + {t("common_unit_dbm")}
{path.map((hop, i) => ( @@ -45,7 +45,7 @@ const RoutePath = (↓ {snr?.[i + 1] ?? t("traceRoute_snrUnknown")} - {t("common.dbUnit")} + {t("common_unit_dbm")}
))} diff --git a/src/tests/setupTests.ts b/src/tests/setupTests.ts index e5826209..34c5fd07 100644 --- a/src/tests/setupTests.ts +++ b/src/tests/setupTests.ts @@ -3,6 +3,9 @@ import { cleanup } from "@testing-library/react"; import { enableMapSet } from "immer"; import "@testing-library/jest-dom"; import "@testing-library/user-event"; +import i18n from "i18next"; +import { initReactI18next } from "react-i18next"; +import enTranslations from "@app/i18n/locales/en.json"; enableMapSet(); @@ -14,12 +17,31 @@ vi.mock("idb-keyval", () => ({ keys: vi.fn(() => Promise.resolve([])), createStore: vi.fn(() => ({})), })); + globalThis.ResizeObserver = class { observe() {} unobserve() {} disconnect() {} }; +i18n + .use(initReactI18next) + .init({ + lng: "en", + fallbackLng: "en", + debug: false, + resources: { + en: { + translation: enTranslations, + }, + }, + interpolation: { + escapeValue: false, + }, + defaultNS: "translation", + initImmediate: true, + }); + afterEach(() => { cleanup(); }); diff --git a/vitest.config.ts b/vitest.config.ts index aaed988c..24aa0ac4 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,6 +1,6 @@ import path from "node:path"; -import react from '@vitejs/plugin-react'; -import { defineConfig } from 'vitest/config' +import react from "@vitejs/plugin-react"; +import { defineConfig } from "vitest/config"; import { enableMapSet } from "immer"; enableMapSet(); @@ -10,21 +10,21 @@ export default defineConfig({ ], resolve: { alias: { - '@app': path.resolve(process.cwd(), './src'), - '@core': path.resolve(process.cwd(), './src/core'), - '@pages': path.resolve(process.cwd(), './src/pages'), - '@components': path.resolve(process.cwd(), './src/components'), - '@layouts': path.resolve(process.cwd(), './src/layouts'), + "@app": path.resolve(process.cwd(), "./src"), + "@core": path.resolve(process.cwd(), "./src/core"), + "@pages": path.resolve(process.cwd(), "./src/pages"), + "@components": path.resolve(process.cwd(), "./src/components"), + "@layouts": path.resolve(process.cwd(), "./src/layouts"), }, }, test: { - environment: 'happy-dom', + environment: "happy-dom", globals: true, mockReset: true, clearMocks: true, restoreMocks: true, - root: path.resolve(process.cwd(), './src'), - include: ['**/*.{test,spec}.{ts,tsx}'], + root: path.resolve(process.cwd(), "./src"), + include: ["**/*.{test,spec}.{ts,tsx}"], setupFiles: ["./src/tests/setupTests.ts"], }, -}) \ No newline at end of file +});