forked from baron/baron-sso
로컬/CI 테스트 동기화
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user