import { expect, test } from "bun:test" import { stylesheetLinks } from "~/lib/head-links" const css = (name: string) => `` test("a page's stylesheets in its head are named in its Link header", () => { expect( stylesheetLinks(`${css("shell-a")}${css("home-b")}${css("late")}`), ).toBe("; rel=preload; as=style, ; rel=preload; as=style") }) test("a page without stylesheets in its head gets no Link header", () => { expect(stylesheetLinks(`${css("body")}`)).toBeUndefined() })