import { describe, expect, it } from "vitest"; import {PUBLIC_FIXTURE_URLS,launchpadFixtureLink} from "../public/transport-fixtures.js"; describe("Public Scramjet fixture links",()=>{ it("uses supported static HTML, image, redirect and UTF-8 URLs instead of escaped Base64 HTML",()=>{ expect(Object.keys(PUBLIC_FIXTURE_URLS)).toHaveLength(4); for(const target of Object.values(PUBLIC_FIXTURE_URLS)){ const parsed=new URL(target); expect(parsed.origin).toBe("https://httpbingo.org"); expect(parsed.pathname).not.toContain("/base64/"); const link=launchpadFixtureLink(target); expect(new URLSearchParams(link.split("?")[1]).get("target")).toBe(target); } }); it("rejects non-fixture or insecure hosts",()=>{ expect(()=>launchpadFixtureLink("http://httpbingo.org/html")).toThrow(); expect(()=>launchpadFixtureLink("https://httpbingo.org.evil.example/html")).toThrow(); expect(()=>launchpadFixtureLink("https://127.0.0.1/html")).toThrow(); }); });