push to maple-street

This commit is contained in:
Tiel Coder
2026-11-20 04:07:02 +00:00
parent 2cec220a24
commit 5adf1cef1f
345 changed files with 86105 additions and 1079 deletions
+14 -20
View File
@@ -1,25 +1,19 @@
import { test, expect, type Page } from "@playwright/test";
import { test, expect } from "@playwright/test";
import { signInAs, BASE } from "./dev";
const BASE = "http://localhost:3000";
const TAB_LABELS = ["Schedule", "Roster", "Training", "Announcements", "Settings"];
/**
* Dev console transport: request a magic link, then complete it in the browser
* context so the Auth.js session cookie is set for the navigation under test.
*/
async function signInAs(page: Page, email: string) {
const res = await page.request.post(`${BASE}/api/dev/magic-link`, {
data: { email },
});
expect(res.ok(), "magic-link request should succeed").toBe(true);
const body = (await res.json()) as { url?: string };
expect(body.url, "magic-link should return a sign-in url").toBeTruthy();
await page.goto(body.url!);
await expect(page).toHaveURL(/complete/);
}
const TAB_LABELS = [
"Home",
"Schedule",
"Events",
"Media",
"Roster",
"Training",
"Announcements",
"Settings",
];
test.describe("app shell", () => {
test("renders the shell with 5 nav tabs at a 360px viewport", async ({ page }) => {
test("renders the shell with 8 nav tabs at a 360px viewport", async ({ page }) => {
await page.setViewportSize({ width: 360, height: 780 });
await signInAs(page, `e2e-mobile-${Date.now()}@example.com`);
@@ -29,7 +23,7 @@ test.describe("app shell", () => {
// Header + page title.
await expect(page.getByRole("heading", { name: "Schedule", level: 1 })).toBeVisible();
// Five nav tabs, one per label.
// One tab per primary destination.
for (const label of TAB_LABELS) {
await expect(page.getByRole("link", { name: label, exact: true })).toBeVisible();
}