Files
Claude 10a7d0a878 Add the North America managed services role to the resume
Implico role becomes "Team Lead, BTP Cloud & Mobile Apps and North
America Managed Services" with a bullet for the practice Greg took on
in June 2026. The resume PDF now tightens spacing when it just spills
onto a second page so it stays on one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aSbo2D1qP8cMFQCykf7kx
2026-10-12 04:07:36 +00:00

47 lines
1.7 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { fitBody, renderBody } from "../src/lib/resume-pdf.ts";
import type { ResumeData } from "../src/lib/resume.ts";
const role = (n: number) =>
({
path: `Resume/Role ${n}.md`,
title: `Role ${n}`,
data: { type: "experience", title: `Role ${n}`, publish: true, company: "Example Co", role: `Role ${n}`, start: "2019-03", bullets: ["Built a thing that did something useful for people every day.", "Led a small team."] },
}) as unknown as ResumeData["roles"][number];
const base: ResumeData = {
name: "Greg Kilmer",
headline: "Team Lead",
summary: "A short summary.",
stats: [],
roles: [role(1)],
earlier: [],
projects: [],
socials: [],
updated: "2026-10-12",
};
describe("resume PDF fit", () => {
it("opens a short resume up to fill its one page", async () => {
const medium = { ...base, roles: Array.from({ length: 6 }, (_, i) => role(i)) };
const fitted = await fitBody(medium);
expect(fitted.pages).toBe(1);
expect(fitted.end).toBeLessThanOrEqual(792 - 70);
// At normal spacing six short roles end well above the middle of the page.
expect(fitted.end).toBeGreaterThan(560);
});
it("tightens a resume that just spills onto a second page", async () => {
const ten = { ...base, roles: Array.from({ length: 10 }, (_, i) => role(i)) };
expect((await renderBody(ten)).pages).toBe(2);
const fitted = await fitBody(ten);
expect(fitted.pages).toBe(1);
expect(fitted.end).toBeLessThanOrEqual(792 - 70);
});
it("leaves a resume that runs well past one page alone", async () => {
const long = await fitBody({ ...base, roles: Array.from({ length: 12 }, (_, i) => role(i)) });
expect(long.pages).toBeGreaterThan(1);
});
});