Refactor languageHandler to avoid import cycles (#33948)

* Refactor languageHandler to avoid import cycles

Also move its tests to vitest

* Small refactor

* Iterate

* Iterate
This commit is contained in:
Michael Telatynski
2026-06-24 09:49:49 +00:00
committed by GitHub
parent 29b9c04d20
commit f9b97be1d7
38 changed files with 780 additions and 555 deletions
@@ -36,7 +36,7 @@ import {
import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext";
import { type RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks";
import { type MediaEventHelper } from "../../../../../src/utils/MediaEventHelper";
import * as languageHandler from "../../../../../src/languageHandler";
import * as languageSettings from "../../../../../src/i18n/settings";
const CHECKED = "mx_PollOption_checked";
const userId = "@me:example.com";
@@ -55,7 +55,7 @@ describe("MPollBody", () => {
mockClient.getRoom.mockReturnValue(null);
mockClient.relations.mockResolvedValue({ events: [] });
jest.spyOn(languageHandler, "getUserLanguage").mockReturnValue("en-GB");
jest.spyOn(languageSettings, "getUserLanguage").mockReturnValue("en-GB");
});
it("finds no votes if there are none", () => {