fix: render cover letter exports without resume chrome

This commit is contained in:
Amruth Pillai
2026-07-07 17:47:52 +02:00
parent 5270a2a9a0
commit 8570c1c70a
25 changed files with 175 additions and 23 deletions
@@ -0,0 +1,37 @@
import { readFileSync } from "node:fs";
import { basename } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
const pageFiles = [
"azurill/AzurillPage.tsx",
"bronzor/BronzorPage.tsx",
"chikorita/ChikoritaPage.tsx",
"ditgar/DitgarPage.tsx",
"ditto/DittoPage.tsx",
"gengar/GengarPage.tsx",
"glalie/GlaliePage.tsx",
"kakuna/KakunaPage.tsx",
"lapras/LaprasPage.tsx",
"leafish/LeafishPage.tsx",
"meowth/MeowthPage.tsx",
"onyx/OnyxPage.tsx",
"pikachu/PikachuPage.tsx",
"rhyhorn/RhyhornPage.tsx",
"scizor/ScizorPage.tsx",
];
const readTemplate = (file: string) => {
const path = fileURLToPath(new URL(file, import.meta.url));
return readFileSync(path, "utf8");
};
describe("cover letter PDF layout", () => {
it.each(pageFiles)("%s suppresses the resume header for cover-letter-only documents", (file) => {
const source = readTemplate(file);
expect(source, basename(file)).toContain('from "../shared/cover-letter"');
expect(source, basename(file)).toContain("shouldShowResumeHeader(data, pageIndex)");
expect(source, basename(file)).not.toContain("const showHeader = pageIndex === 0;");
});
});