Reload app after login
This commit is contained in:
@@ -32,6 +32,25 @@ test("home page loads auth entry points", async ({ page }) => {
|
||||
await expect(page.getByLabel("Password").nth(1)).toBeVisible();
|
||||
});
|
||||
|
||||
test("successful login transitions to play workspace", async ({ page, context }) => {
|
||||
const username = `login-${Date.now()}`;
|
||||
const password = "Password123";
|
||||
|
||||
await postJson(context.request, "/api/auth/register", {
|
||||
username,
|
||||
password,
|
||||
displayName: "Login Flow"
|
||||
});
|
||||
|
||||
await page.goto("/");
|
||||
await page.locator("#login-username").fill(username);
|
||||
await page.locator("#login-password").fill(password);
|
||||
await page.getByRole("button", { name: "Login" }).click();
|
||||
|
||||
await expect(page.getByText("Campaign Log")).toBeVisible();
|
||||
await expect(page.locator("#login-username")).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("Rolemaster open-ended roll detail renders specialized dice chips", async ({ page, context }) => {
|
||||
const username = `rm-${Date.now()}`;
|
||||
const displayName = "Rolemaster Smoke";
|
||||
@@ -58,6 +77,7 @@ test("Rolemaster open-ended roll detail renders specialized dice chips", async (
|
||||
|
||||
await page.goto("/");
|
||||
await expect(page.getByText("Campaign Log")).toBeVisible();
|
||||
await expect(page.locator(".log-panel .log-entry").first()).toBeVisible();
|
||||
await expect(page.locator(".log-panel .log-event-badge")).toContainText(["Fumble"]);
|
||||
|
||||
const logEntry = page.locator(".log-panel .log-entry-toggle").first();
|
||||
|
||||
Reference in New Issue
Block a user