Files
hmbown--codewhale/web/lib/software-application-schema.test.ts
CodeWhale Bot 93b14c4dde fix(web): publish truthful software schema versions
Derive SoftwareApplication softwareVersion only from the published-release receipt backing the install URL. Omit the field when no published release is known so a source candidate is never presented as downloadable.

Verified with focused schema tests, ESLint, TypeScript, and diff checking.
2026-08-07 21:46:02 -07:00

18 lines
687 B
TypeScript

import { describe, expect, it } from "vitest";
import { buildSoftwareApplicationJsonLd } from "./software-application-schema";
describe("SoftwareApplication structured data", () => {
it("uses the published version advertised by the release-backed install URL", () => {
const schema = buildSoftwareApplicationJsonLd({ version: "0.9.3" });
expect(schema.downloadUrl).toBe("https://codewhale.net/en/install");
expect(schema.softwareVersion).toBe("0.9.3");
});
it("omits softwareVersion when no published release receipt is available", () => {
const schema = buildSoftwareApplicationJsonLd(null);
expect(schema).not.toHaveProperty("softwareVersion");
});
});