forked from baron/baron-sso
profile mock 추가
This commit is contained in:
@@ -28,6 +28,18 @@ test.describe("Tenant Owners Management", () => {
|
||||
},
|
||||
);
|
||||
|
||||
// Mock user profile
|
||||
await page.route("**/api/v1/user/me", async (route) => {
|
||||
await route.fulfill({
|
||||
json: {
|
||||
id: "admin-user",
|
||||
name: "Admin User",
|
||||
email: "admin@example.com",
|
||||
role: "super_admin",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// Mock tenant details
|
||||
await page.route("**/api/v1/admin/tenants/tenant-1**", async (route) => {
|
||||
await route.fulfill({
|
||||
@@ -55,12 +67,22 @@ test.describe("Tenant Owners Management", () => {
|
||||
},
|
||||
);
|
||||
|
||||
await page.goto("/tenants/tenant-1/owners");
|
||||
// Mock admins list (empty)
|
||||
await page.route(
|
||||
"**/api/v1/admin/tenants/tenant-1/admins**",
|
||||
async (route) => {
|
||||
await route.fulfill({ json: [] });
|
||||
},
|
||||
);
|
||||
|
||||
await page.goto("/tenants/tenant-1/permissions");
|
||||
|
||||
// Check if the page title and the owner are visible
|
||||
await expect(page.locator("h3")).toContainText("테넌트 소유자");
|
||||
await expect(page.locator("table")).toContainText("Owner One");
|
||||
await expect(page.locator("table")).toContainText("owner1@example.com");
|
||||
await expect(page.getByText("테넌트 소유자")).toBeVisible();
|
||||
await expect(page.locator("table").first()).toContainText("Owner One");
|
||||
await expect(page.locator("table").first()).toContainText(
|
||||
"owner1@example.com",
|
||||
);
|
||||
});
|
||||
|
||||
test("should add a new owner", async ({ page }) => {
|
||||
@@ -76,6 +98,14 @@ test.describe("Tenant Owners Management", () => {
|
||||
},
|
||||
);
|
||||
|
||||
// Mock admins list (empty)
|
||||
await page.route(
|
||||
"**/api/v1/admin/tenants/tenant-1/admins**",
|
||||
async (route) => {
|
||||
await route.fulfill({ json: [] });
|
||||
},
|
||||
);
|
||||
|
||||
// Mock users search
|
||||
await page.route("**/api/v1/admin/users?**", async (route) => {
|
||||
await route.fulfill({
|
||||
@@ -88,7 +118,7 @@ test.describe("Tenant Owners Management", () => {
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/tenants/tenant-1/owners");
|
||||
await page.goto("/tenants/tenant-1/permissions");
|
||||
|
||||
// Click add button
|
||||
await page.click('button:has-text("소유자 추가")');
|
||||
|
||||
Reference in New Issue
Block a user