19 lines
728 B
TypeScript
19 lines
728 B
TypeScript
import { existsSync, readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
import { getAssetPath, governanceBookletPath } from "../../../lib/assetUtils";
|
|
|
|
describe("governance booklet", () => {
|
|
it("ships a PDF at the About Book download path", () => {
|
|
const relative = governanceBookletPath();
|
|
expect(relative).toBe("assets/marketing/governance-booklet.pdf");
|
|
expect(getAssetPath(relative)).toBe("/assets/marketing/governance-booklet.pdf");
|
|
|
|
const abs = join(process.cwd(), "public", relative);
|
|
expect(existsSync(abs)).toBe(true);
|
|
|
|
const header = readFileSync(abs).subarray(0, 5).toString("latin1");
|
|
expect(header).toBe("%PDF-");
|
|
});
|
|
});
|