forked from baron/baron-sso
test: update adminfront e2e tests for new organization UI
This commit is contained in:
@@ -87,8 +87,12 @@ test.describe("Bulk Actions and Tree Search", () => {
|
||||
if (url.includes("/admin/tenants")) {
|
||||
return route.fulfill({
|
||||
json: {
|
||||
items: [{ id: "t-1", name: "Main Tenant", slug: "main" }],
|
||||
total: 1,
|
||||
items: [
|
||||
{ id: "t-1", name: "Main Tenant", slug: "main", type: "COMPANY" },
|
||||
{ id: "g-1", name: "Engineering", slug: "eng", parentId: "t-1", type: "USER_GROUP" },
|
||||
{ id: "g-2", name: "Sales", slug: "sales", parentId: "t-1", type: "USER_GROUP" },
|
||||
],
|
||||
total: 3,
|
||||
},
|
||||
headers,
|
||||
});
|
||||
@@ -157,11 +161,11 @@ test.describe("Bulk Actions and Tree Search", () => {
|
||||
|
||||
await searchInput.fill("Eng");
|
||||
|
||||
const engRow = page
|
||||
.locator("tr")
|
||||
const engNode = page
|
||||
.locator("button")
|
||||
.filter({ hasText: "Engineering" })
|
||||
.first();
|
||||
await expect(engRow).toBeVisible();
|
||||
await expect(engRow).toHaveClass(/bg-primary/);
|
||||
await expect(engNode).toBeVisible();
|
||||
await expect(engNode).toHaveClass(/bg-primary\/5/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -175,27 +175,17 @@ test.describe("Tenants Management", () => {
|
||||
});
|
||||
|
||||
await page.goto("/tenants/parent-1/organization");
|
||||
await expect(page.locator("table")).toContainText("Parent Org", {
|
||||
timeout: 20000,
|
||||
});
|
||||
|
||||
const parentRow = page
|
||||
.locator("tr")
|
||||
.filter({ hasText: "Parent Org" })
|
||||
.first();
|
||||
await expect(parentRow).toContainText("5");
|
||||
|
||||
const memberButton = parentRow
|
||||
.getByRole("button")
|
||||
.filter({ hasText: /Direct|소속|직속/ })
|
||||
.first();
|
||||
await memberButton.click();
|
||||
|
||||
await expect(
|
||||
page
|
||||
.locator('button[role="tab"]')
|
||||
.filter({ hasText: /소속 멤버|Direct Members/i })
|
||||
.first(),
|
||||
page.locator(".font-bold, h2").filter({ hasText: "Parent Org" }).first()
|
||||
).toBeVisible({ timeout: 20000 });
|
||||
|
||||
await expect(
|
||||
page.locator(".grid .font-bold, .grid .text-sm").filter({ hasText: "Child Team" }).first()
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.locator("h3").filter({ hasText: /소속 멤버|Members/i }).first()
|
||||
).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user