import { readFileSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { describe, expect, it } from "vitest"; function source(file: string): string { return readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), file), "utf8"); } describe("KWP activity and sync-run summary i18n contract", () => { it("persists semantic keys for project, archive and inbound synchronization", () => { const sources = [ source("project-domain.server.ts"), source("project-sync.server.ts"), source("archive-file.server.ts"), source("inbound-sync.server.ts"), ].join("\n"); for (const key of [ "activity.runtime.kwp.projectConnected", "activity.runtime.kwp.projectDisconnectedRestored", "activity.runtime.kwp.contactImported", "activity.runtime.kwp.projectMissing", "activity.runtime.kwp.projectStageChanged", "activity.runtime.kwp.projectUpdated", "activity.runtime.kwp.archiveImported", "activity.runtime.kwp.inboundDataUpdated", "integrations.sync.summary.kwpProjectImported", "integrations.sync.summary.kwpProjectSyncStarted", "integrations.sync.summary.kwpArchiveImportStarted", "integrations.sync.summary.kwpInboundSyncStarted", ]) { expect(sources).toContain(key); } expect(sources).not.toMatch(/summaryText:\s*`(?:KWP|Projekt|Archivdatei|Termine)/u); }); });