forked from baron/baron-sso
Playwright 테스트 오류 수정
This commit is contained in:
@@ -20,7 +20,9 @@ test.describe("Tenant Owners Management", () => {
|
||||
window.localStorage.setItem(key, JSON.stringify(authData));
|
||||
window.localStorage.setItem("admin_session", "fake-token");
|
||||
window.localStorage.setItem("locale", "ko");
|
||||
(window as any)._IS_TEST_MODE = true;
|
||||
(
|
||||
window as Window & typeof globalThis & { _IS_TEST_MODE?: boolean }
|
||||
)._IS_TEST_MODE = true;
|
||||
});
|
||||
|
||||
await page.route("**/oidc/**", async (route) => {
|
||||
@@ -29,7 +31,8 @@ test.describe("Tenant Owners Management", () => {
|
||||
|
||||
await page.route(/.*\/api\/v1\/.*/, async (route) => {
|
||||
const url = route.request().url();
|
||||
if (url.includes("/user/me")) { console.log("Mocking ME");
|
||||
if (url.includes("/user/me")) {
|
||||
console.log("Mocking ME");
|
||||
return route.fulfill({
|
||||
json: {
|
||||
id: "admin-user",
|
||||
@@ -85,27 +88,39 @@ test.describe("Tenant Owners Management", () => {
|
||||
|
||||
await expect(page.getByText(/테넌트 소유자|Tenant Owners/)).toBeVisible();
|
||||
await expect(page.locator("table").first()).toContainText("Owner One");
|
||||
await expect(page.locator("table").first()).toContainText("owner1@example.com");
|
||||
await expect(page.locator("table").first()).toContainText(
|
||||
"owner1@example.com",
|
||||
);
|
||||
});
|
||||
|
||||
test("should add a new owner", async ({ page }) => {
|
||||
// Specific override for this test
|
||||
await page.route("**/api/v1/admin/tenants/tenant-1/owners", async (route) => {
|
||||
if (route.request().method() === "GET") {
|
||||
await route.fulfill({ json: [] });
|
||||
} else {
|
||||
await route.fulfill({ status: 200, json: {} });
|
||||
}
|
||||
});
|
||||
await page.route(
|
||||
"**/api/v1/admin/tenants/tenant-1/owners",
|
||||
async (route) => {
|
||||
if (route.request().method() === "GET") {
|
||||
await route.fulfill({ json: [] });
|
||||
} else {
|
||||
await route.fulfill({ status: 200, json: {} });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await page.goto("/tenants/tenant-1/permissions");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await expect(page.locator(".animate-spin").first()).not.toBeVisible();
|
||||
|
||||
await page.click('button:has-text("소유자 추가"), button:has-text("Add Owner")');
|
||||
await page.fill('input[placeholder*="사용자 검색"], input[placeholder*="Search users"]', "User Two");
|
||||
await page.click(
|
||||
'button:has-text("소유자 추가"), button:has-text("Add Owner")',
|
||||
);
|
||||
await page.fill(
|
||||
'input[placeholder*="사용자 검색"], input[placeholder*="Search users"]',
|
||||
"User Two",
|
||||
);
|
||||
|
||||
const addButton = page.locator("role=dialog").getByRole("button", { name: /추가|Add/ });
|
||||
const addButton = page
|
||||
.locator("role=dialog")
|
||||
.getByRole("button", { name: /추가|Add/ });
|
||||
await addButton.click();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user