1
0
forked from baron/baron-sso

23cd316c23 기준 병합 code-check 오류 수정

This commit is contained in:
2026-05-29 18:26:01 +09:00
parent cadb0631fd
commit 86940cce9e
2 changed files with 24 additions and 39 deletions

View File

@@ -189,44 +189,19 @@ async function makeWindowCloseNavigateToRoot(page: Page): Promise<void> {
});
}
async function clickVerificationAction(page: Page): Promise<void> {
await page.waitForTimeout(500);
if (page.isClosed() || !page.url().includes("/verify-complete")) {
return;
}
const viewport = page.viewportSize();
if (!viewport) {
throw new Error("Viewport size was not available.");
}
await page.mouse.click(
viewport.width / 2,
Math.min(viewport.height - 24, viewport.height / 2 + 120),
);
}
async function enableFlutterAccessibility(page: Page): Promise<void> {
await page.waitForTimeout(300);
const button = page.getByRole("button", { name: "Enable accessibility" });
if (await button.count()) {
await button.first().click({ force: true }).catch(async () => {
await button.first().evaluate((node) => {
(node as HTMLElement).click();
});
});
await page.waitForTimeout(500);
return;
}
const placeholder = page.locator("flt-semantics-placeholder").first();
if (await placeholder.count()) {
await placeholder.click({ force: true }).catch(async () => {
await button.click({ force: true, timeout: 1_000 }).catch(async () => {
await placeholder.click({ force: true, timeout: 1_000 }).catch(async () => {
await placeholder.evaluate((node) => {
(node as HTMLElement).click();
});
});
await page.waitForTimeout(800);
}
});
await page.waitForTimeout(500);
}
test.describe("UserFront WASM auth routing", () => {
@@ -366,7 +341,8 @@ test.describe("UserFront WASM auth routing", () => {
await expect(page).toHaveURL(/\/ko\/verify-complete$/);
expect(userMeCalls).toBe(0);
await clickVerificationAction(page);
await enableFlutterAccessibility(page);
await page.getByRole("button", { name: "로그인 창으로 이동하기" }).click();
expect(userMeCalls).toBe(0);
await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/);
@@ -529,7 +505,10 @@ test.describe("UserFront WASM auth routing", () => {
if (!popup.isClosed()) {
const closePromise = popup.waitForEvent("close").catch(() => undefined);
try {
await clickVerificationAction(popup);
await enableFlutterAccessibility(popup);
await popup
.getByRole("button", { name: "로그인 창으로 이동하기" })
.click();
} catch (error) {
if (!popup.isClosed()) {
throw error;
@@ -573,7 +552,8 @@ test.describe("UserFront WASM auth routing", () => {
verifyOnly: true,
});
await clickVerificationAction(page);
await enableFlutterAccessibility(page);
await page.getByRole("button", { name: "로그인 창으로 이동하기" }).click();
expect(userMeCalls).toBe(0);
await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/);
@@ -614,7 +594,8 @@ test.describe("UserFront WASM auth routing", () => {
verifyOnly: true,
});
await clickVerificationAction(page);
await enableFlutterAccessibility(page);
await page.getByRole("button", { name: "로그인 창으로 이동하기" }).click();
expect(userMeCalls).toBe(0);
await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/);

View File

@@ -115,15 +115,19 @@ async function mockSignupApis(page: Page): Promise<void> {
}
async function enableFlutterAccessibility(page: Page): Promise<void> {
await page.waitForTimeout(300);
const button = page.getByRole('button', { name: 'Enable accessibility' });
if (await button.count()) {
await button.first().click({ force: true }).catch(async () => {
await page.locator('flt-semantics-placeholder').first().evaluate((node) => {
const placeholder = page.locator('flt-semantics-placeholder').first();
await button.click({ force: true, timeout: 1_000 }).catch(async () => {
await placeholder.click({ force: true, timeout: 1_000 }).catch(async () => {
await placeholder.evaluate((node) => {
(node as HTMLElement).click();
});
});
await page.waitForTimeout(400);
}
});
await page.waitForTimeout(400);
}
async function typeIntoField(page: Page, locator: Locator, value: string): Promise<void> {