import { describe, expect, mock, test } from "bun:test";
mock.module("cloudflare:workers", () => ({ env: { FORGE_NAME: "gitfor" }, waitUntil: () => undefined }));
const { claimPage } = await import("./claim-page");
describe("claim page", () => {
test("defaults the repository to private and reads the token from the fragment under a nonce", async () => {
const response = claimPage("alice", "", "abc123");
const body = await response.text();
expect(body).toMatch(//);
expect(body).not.toContain("checked");
expect(body).toContain('