1
0
forked from baron/baron-sso

로컬/CI 테스트 동기화

This commit is contained in:
Lectom C Han
2026-02-24 16:42:55 +09:00
parent 8a074f16e7
commit 7fee9c597a
11 changed files with 277 additions and 92 deletions

View File

@@ -75,8 +75,18 @@ async function mockUserfrontApis(
}
if (path.endsWith('/api/v1/auth/qr/approve')) {
const body = route.request().postDataJSON() as { pendingRef?: string };
options.captureApprove?.(body.pendingRef ?? null);
if (route.request().method() == 'POST') {
let pendingRef: string | null = null;
try {
const body = (route.request().postDataJSON() ?? {}) as {
pendingRef?: string;
};
pendingRef = body.pendingRef ?? null;
} catch (_) {
pendingRef = null;
}
options.captureApprove?.(pendingRef);
}
await route.fulfill({
status: 200,
contentType: 'application/json',
@@ -137,7 +147,9 @@ test.describe('UserFront WASM auth routing', () => {
await page.goto('/ko/approve?ref=e2e-approve-ref');
await expect(page).toHaveURL(/\/ko\/dashboard$/);
await expect(page).toHaveURL(/\/ko\/dashboard(?:\?.*)?$/, {
timeout: 10_000,
});
expect(approvedRef).toBe('e2e-approve-ref');
});
});