Files
jobtrackingapp/job-tracker-ui/src/correspondence-search-context.test.ts
T
2026-08-10 09:36:11 +02:00

18 lines
969 B
TypeScript

import { buildSuggestedCorrespondenceQueries } from "./components/Correspondence";
test("builds contextual suggestions for the shared application correspondence view", () => {
expect(buildSuggestedCorrespondenceQueries(
{ companyName: "Acme AS", recruiterEmail: "recruiter@acme.test", jobTitle: "Utvikler" },
["Interview invitation", "Interview invitation"],
)).toEqual([
{ label: "Recruiter mailbox", value: "(from:recruiter@acme.test OR to:recruiter@acme.test) newer_than:365d" },
{ label: "Company + role", value: "\"Acme AS\" \"Utvikler\" newer_than:365d" },
{ label: "Company mail", value: "\"Acme AS\" (application OR interview OR recruiter) newer_than:365d" },
{ label: "Subject: Interview invitation", value: "subject:\"Interview invitation\" newer_than:365d" },
]);
});
test("does not invent weak context when the workspace has no company details", () => {
expect(buildSuggestedCorrespondenceQueries({}, [])).toEqual([]);
});