Files

27 lines
1.1 KiB
TypeScript

import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
const routeSource = readFileSync(
resolve(process.cwd(), "apps/web/app/routes/app.$tenant/email-marketing/campaigns/$id.tsx"),
"utf8"
);
const screenSource = readFileSync(
resolve(process.cwd(), "apps/web/app/components/screens/email-marketing/EmailMarketingInterimScreens.tsx"),
"utf8"
);
describe("email marketing campaign localization", () => {
it("uses the request locale and translated immediate-delivery label", () => {
expect(routeSource).toContain("new Intl.DateTimeFormat(locale,");
expect(routeSource).toContain('t("emailMarketing.presend.immediately")');
expect(routeSource).not.toContain('new Intl.DateTimeFormat("de-DE"');
expect(routeSource).not.toContain(': "sofort"');
});
it("formats lifecycle timestamps with the active UI language", () => {
expect(screenSource).toContain("new Intl.DateTimeFormat(i18n.language,");
expect(screenSource).not.toContain("new Intl.DateTimeFormat(undefined,");
});
});