import assert from "node:assert/strict"; import { dirname, join } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; import ejs from "ejs"; const authCard = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "views", "partials", "auth-card.ejs"); const render = (data: Record = {}): Promise => ejs.renderFile(authCard, data); const flat = (s: string): string => s.replace(/>\s+<").replace(/\s+/g, " ").trim(); test("auth-card renders head, SSO providers (text logo + icon link), body slot and alt footer", async () => { const html = flat(await render({ title: "Sign in", sub: "Welcome back.", action: "/login", sso: { providers: [ { label: "Continue with Google", logo: "G" }, { label: "Continue with SAML SSO", icon: "i-shield", href: "/sso/saml" }, { label: "Sign in with Microsoft", logo: "M", name: "provider", value: "microsoft" }, ] }, body: '
FORM
', alt: { text: "Don't have an account?", href: "/register", label: "Create one" }, })); assert.match(html, /