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:
@@ -27,7 +27,7 @@ import {
|
||||
DAY_MS,
|
||||
} from "../../../src/DateUtils";
|
||||
import { REPEATABLE_DATE, mockIntlDateTimeFormat, unmockIntlDateTimeFormat } from "../../test-utils";
|
||||
import * as languageHandler from "../../../src/languageHandler";
|
||||
import * as languageSettings from "../../../src/i18n/settings";
|
||||
|
||||
describe("getDaysArray", () => {
|
||||
it("should return Sunday-Saturday in long mode", () => {
|
||||
@@ -369,7 +369,7 @@ describe("formatLocalDateShort()", () => {
|
||||
});
|
||||
const timestamp = new Date("Fri Dec 17 2021 09:09:00 GMT+0100 (Central European Standard Time)").getTime();
|
||||
it("formats date correctly by locale", () => {
|
||||
const locale = jest.spyOn(languageHandler, "getUserLanguage");
|
||||
const locale = jest.spyOn(languageSettings, "getUserLanguage");
|
||||
mockIntlDateTimeFormat();
|
||||
|
||||
// format is DD/MM/YY
|
||||
|
||||
Reference in New Issue
Block a user