import fs from "node:fs"; import path from "node:path"; import { describe, expect, it } from "vitest"; import { resolveRepoPath } from "~/utils/testing/repoPaths"; function source(relativePath: string): string { return fs.readFileSync(path.join(resolveRepoPath("."), relativePath), "utf8"); } describe("email activity summary i18n contract", () => { it("persists semantic keys across send, matching, inbound and manual-link paths", () => { expect(source("apps/web/app/modules/emailInbox/services/EmailSendService.server.ts")).toContain( 'summaryText: "activity.runtime.email.sent"', ); expect(source("packages/integrations/src/email-match-hook.server.ts")).toContain( '"activity.runtime.email.received" : "activity.runtime.email.sent"', ); const inbound = source("packages/db/src/email-inbound.server.ts"); expect(inbound).toContain('"activity.runtime.email.bccLogged"'); expect(inbound).toContain('"activity.runtime.email.received"'); expect(source("apps/web/app/routes/app.$tenant/emails.$id.tsx")).toContain( 'summaryText: "activity.runtime.email.manuallyLinked"', ); }); });