1
0
forked from baron/baron-sso

fix userfront mobile approval close flow

This commit is contained in:
2026-05-21 18:14:31 +09:00
parent 66687a4c73
commit e54cc121c7
5 changed files with 100 additions and 30 deletions

View File

@@ -160,6 +160,14 @@ function collectClientFailures(page: Page): string[] {
return failures;
}
async function makeWindowCloseNavigateToRoot(page: Page): Promise<void> {
await page.addInitScript(() => {
window.close = () => {
window.location.href = '/';
};
});
}
test.describe('UserFront WASM auth routing', () => {
test('비로그인 /ko 진입 시 /ko/signin 으로 리다이렉트된다', async ({ page }) => {
await mockUserfrontApis(page, { sessionStatus: 401 });
@@ -239,6 +247,7 @@ test.describe('UserFront WASM auth routing', () => {
verifyRequests.push({ path, body });
},
});
await makeWindowCloseNavigateToRoot(page);
await page.goto('/ko/l/AB123456');
@@ -281,6 +290,7 @@ test.describe('UserFront WASM auth routing', () => {
verifyCalls += 1;
},
});
await makeWindowCloseNavigateToRoot(page);
await page.goto('/ko/l/AB123456');
@@ -375,6 +385,7 @@ test.describe('UserFront WASM auth routing', () => {
verifyRequests.push({ path, body });
},
});
await makeWindowCloseNavigateToRoot(page);
await page.goto('/ko/verify/e2e-email-token');
@@ -423,6 +434,7 @@ test.describe('UserFront WASM auth routing', () => {
verifyRequests.push({ path, body });
},
});
await makeWindowCloseNavigateToRoot(page);
await page.goto(
'/ko/verify?loginId=e2e%40example.com&code=654321&pendingRef=pending-email',