feat: add OpenFleet membership and CoinPay rental contracts

This commit is contained in:
Anthony Ettinger 2026-09-13 06:53:21 +00:00
parent a333726a1e
commit b6cd7cfde2
16 changed files with 933 additions and 2 deletions

View file

@ -0,0 +1,27 @@
import { describe, expect, it, vi } from "vitest";
import { familyOfSpec } from "../src/lib/specs";
import { listDocs, readDoc } from "../src/lib/docs";
import { GET as llms } from "../src/app/llms.txt/route";
import { GET as llmsFull } from "../src/app/llms-full.txt/route";
import sitemap from "../src/app/sitemap";
// Spec discovery must work even when the optional blog database is offline.
vi.mock("../src/lib/supabase", () => ({ publicClient: () => { throw new Error("offline"); } }));
describe("OpenFleet public discovery", () => {
it("serves the specification through the process family and docs index", () => {
expect(familyOfSpec("openfleet")?.slug).toBe("process");
expect(listDocs()).toContainEqual(expect.objectContaining({ slug: "openfleet", title: "OpenFleet" }));
expect(readDoc("openfleet")).toContain('"provider": "coinpay"');
});
it("includes a reachable docs URL and the full contract in the LLM feeds", async () => {
expect(await llms().text()).toMatch(/\[OpenFleet\]\(https:\/\/[^)]+\/docs\/openfleet\)/);
expect(await llmsFull().text()).toContain(readDoc("openfleet")!.trim());
});
it("includes the docs route in the sitemap without a blog connection", async () => {
const entries = await sitemap();
expect(entries.some((entry) => new URL(entry.url).pathname === "/docs/openfleet")).toBe(true);
});
});