31 lines
No EOL
1.3 KiB
TypeScript
31 lines
No EOL
1.3 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
/**
|
|
* Supply box management surface.
|
|
*
|
|
* NOTE: these tests exercise the real dev server and are run in the final
|
|
* verification wave (F3) under the dev-server protocol, not on every change.
|
|
* The list is server-gated: guests get the landing page; only logged-in users
|
|
* see the supply box list (logistics-qualified users additionally get the
|
|
* crate command controls on the detail page).
|
|
*/
|
|
test.describe("Supply box management surface", () => {
|
|
test("guests never see the supply box list", async ({ page }) => {
|
|
await page.goto("/logistics/supply-boxes");
|
|
await expect(page.getByRole("heading", { level: 1 })).toHaveText("Polaris Task Force");
|
|
});
|
|
|
|
test("an authed user sees the supply box list page", async ({ page }) => {
|
|
await page.goto("/login");
|
|
await page.getByLabel("Username").fill("dev");
|
|
await page.getByLabel("Password").fill("Test123");
|
|
await page.getByRole("button", { name: "Log in" }).click();
|
|
|
|
await page.goto("/logistics/supply-boxes");
|
|
await expect(page.getByText("Supply Boxes")).toBeVisible();
|
|
// Either a registered box row or the empty state renders.
|
|
await expect(
|
|
page.getByText("No supply boxes have been registered yet."),
|
|
).toBeVisible();
|
|
});
|
|
}); |