test(me): use committed translations in dashboard tests
This commit is contained in:
1 parent
a647b5451f
commit
440ce4e556
1 file changed
+2
-9
@@ -34,15 +34,8 @@ vi.mock("@/components/link", () => ({
|
|||||||
}));
|
}));
|
||||||
vi.mock("next-intl/server", () => ({
|
vi.mock("next-intl/server", () => ({
|
||||||
getTranslations: async () => {
|
getTranslations: async () => {
|
||||||
const flat = JSON.parse(
|
const messages = JSON.parse(readFileSync("src/messages/it.json", "utf8"))
|
||||||
readFileSync("docs/task-account-i18n.json", "utf8"),
|
.pages.myDashboard.tasks;
|
||||||
).it;
|
|
||||||
const messages = Object.fromEntries(
|
|
||||||
Object.entries(flat).map(([key, value]) => [
|
|
||||||
key.replace("pages.myDashboard.tasks.", ""),
|
|
||||||
value,
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
return createTranslator({ locale: "it", messages });
|
return createTranslator({ locale: "it", messages });
|
||||||
},
|
},
|
||||||
getFormatter: async () => ({
|
getFormatter: async () => ({
|
||||||
|
|||||||
Reference in new issue
Block a user