1
0
forked from baron/baron-sso

test(adminfront): fix failing E2E tests for audit and users

- Relaxed audit log mock route matching to prevent empty state failures
- Fixed strict mode violation on appointment '추가' button by scoping to tabpanel
- Fixed UserDetailPage typescript compilation error during test build
This commit is contained in:
2026-05-29 16:10:01 +09:00
parent 2da470922b
commit 8d2e2c58fe
3 changed files with 8 additions and 8 deletions

View File

@@ -661,15 +661,15 @@ function UserDetailPage() {
string,
Record<string, string | number | boolean>
>) || {}),
sub_email: (Array.isArray(user.metadata?.sub_email)
sub_email: Array.isArray(user.metadata?.sub_email)
? user.metadata.sub_email
: typeof user.metadata?.sub_email === "string"
? user.metadata.sub_email
.split(/[;,\n\r\t]/)
.map((e) => e.trim())
.filter((e) => e.includes("@"))
: []) as unknown[],
},
: [],
} as any,
});
const isUserHanmacFamily = isHanmacFamilyUser(
user,

View File

@@ -59,7 +59,7 @@ test.describe("Audit Logs Management", () => {
};
test("should load initial logs and display correctly", async ({ page }) => {
await page.route("**/api/v1/audit?limit=50*", async (route) => {
await page.route("**/api/v1/audit*", async (route) => {
return route.fulfill({
json: { items: generateMockLogs(20, 0), total: 20 },
headers: { "Access-Control-Allow-Origin": "*" },
@@ -83,7 +83,7 @@ test.describe("Audit Logs Management", () => {
page,
}) => {
let callCount = 0;
await page.route("**/api/v1/audit?limit=50*", async (route) => {
await page.route("**/api/v1/audit*", async (route) => {
const logs = generateMockLogs(20, callCount * 20);
callCount++;
return route.fulfill({
@@ -108,7 +108,7 @@ test.describe("Audit Logs Management", () => {
});
test("should filter logs by Action and User ID locally", async ({ page }) => {
await page.route("**/api/v1/audit?limit=50*", async (route) => {
await page.route("**/api/v1/audit*", async (route) => {
return route.fulfill({
json: { items: generateMockLogs(20, 0), total: 20 },
headers: { "Access-Control-Allow-Origin": "*" },
@@ -146,7 +146,7 @@ test.describe("Audit Logs Management", () => {
});
test("should filter logs by Status locally", async ({ page }) => {
await page.route("**/api/v1/audit?limit=50*", async (route) => {
await page.route("**/api/v1/audit*", async (route) => {
return route.fulfill({
json: { items: generateMockLogs(20, 0), total: 20 },
headers: { "Access-Control-Allow-Origin": "*" },

View File

@@ -721,7 +721,7 @@ test.describe("User Management", () => {
await expect(page.locator("input#department")).toHaveCount(0);
await expect(page.getByText(/대표 소속/i)).toHaveCount(0);
await page.getByRole("button", { name: /^추가$/i }).click();
await page.getByRole("tabpanel").getByRole("button", { name: /^추가$/i }).click();
await expect(page.getByTestId("appointment-row-0")).toBeVisible();
await expect(
page.getByTestId("appointment-tenant-owner-line-0"),