const { test, expect } = require("@playwright/test"); async function postJson(request, url, data) { const response = await request.post(url, { data }); expect(response.ok()).toBeTruthy(); return await response.json(); } async function registerAndLogin(request, username, displayName) { await postJson(request, "/api/auth/register", { username, password: "Password123", displayName }); const loginResponse = await request.post("/api/auth/login", { data: { username, password: "Password123" } }); expect(loginResponse.ok()).toBeTruthy(); } test("home page loads auth entry points", async ({ page }) => { await page.goto("/"); await expect(page.locator("h1")).toContainText("RpgRoller"); await expect(page.getByRole("heading", { name: "Register" })).toBeVisible(); await expect(page.getByRole("heading", { name: "Login" })).toBeVisible(); await expect(page.getByLabel("Username").first()).toBeVisible(); await expect(page.getByLabel("Password").nth(1)).toBeVisible(); }); test("home document renders static auth markup without bootstrapping blazor", async ({ request }) => { const response = await request.get("/"); expect(response.ok()).toBeTruthy(); const html = await response.text(); expect(html).not.toContain("Connecting..."); expect(html).toContain("Register or log in to join a campaign session."); expect(html).not.toContain("_framework/blazor.web.js"); expect(html).not.toContain("