import { expect, test } from "bun:test";
import { renderToString } from "react-dom/server";
import { MemoryRouter } from "react-router-dom";
import { SignInForms } from "../src/web/account/AccountPage";
import AdminPage from "../src/web/account/AdminPage";
test("the sign-in page has email and password fields and a create-account switch", () => {
const out = renderToString();
expect(out).toContain('type="email"');
expect(out).toContain('type="password"');
expect(out).toContain('autoComplete="current-password"');
expect(out).toContain("Create account");
});
test("the admin page renders its frame before the session is known", () => {
const out = renderToString();
expect(out).toContain("Users, groups and library");
expect(out).not.toContain("Users and roles"); // owner-only sections wait for the session
});