Add Playwright E2E tests replacing Cypress with MSW integration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
33
tests/e2e/specs/accountAdmin.spec.ts
Normal file
33
tests/e2e/specs/accountAdmin.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
// The Lucia project.
|
||||
// Copyright 2026-2026 DSP, inc. All rights reserved.
|
||||
// Authors:
|
||||
// imacat.yang@dsp.im (imacat), 2026/03/22
|
||||
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { loginWithMSW } from "../helpers";
|
||||
|
||||
test.describe("Account Management", () => {
|
||||
test.beforeEach(async ({ context }) => {
|
||||
await loginWithMSW(context);
|
||||
});
|
||||
|
||||
test("displays user list on account admin page", async ({ page }) => {
|
||||
await page.goto("/account-admin");
|
||||
// Should display users from fixture
|
||||
await expect(page.getByText("Test Admin").first()).toBeVisible();
|
||||
await expect(page.getByText("Alice Wang")).toBeVisible();
|
||||
await expect(page.getByText("Bob Chen")).toBeVisible();
|
||||
});
|
||||
|
||||
test("shows active/inactive status badges", async ({ page }) => {
|
||||
await page.goto("/account-admin");
|
||||
await expect(page.getByText("Test Admin").first()).toBeVisible();
|
||||
// The user list should show status indicators
|
||||
await expect(page.getByText("testadmin")).toBeVisible();
|
||||
});
|
||||
|
||||
test("navigates to my-account page", async ({ page }) => {
|
||||
await page.goto("/my-account");
|
||||
await expect(page).toHaveURL(/\/my-account/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user