1
0
forked from baron/baron-sso

코드 테스트 실패 수정

This commit is contained in:
2026-06-11 08:55:41 +09:00
parent 4d77060b5d
commit 0bb3ccb850
13 changed files with 517 additions and 382 deletions

View File

@@ -178,15 +178,6 @@ function collectClientFailures(page: Page): string[] {
return failures;
}
async function expectPageToRemainBlank(page: Page): Promise<void> {
await expect
.poll(() => {
const url = page.url();
return url === '' || url === 'about:blank';
}, { timeout: 5_000 })
.toBe(true);
}
async function makeWindowCloseNavigateToRoot(page: Page): Promise<void> {
await page.addInitScript(() => {
window.close = () => {
@@ -276,7 +267,7 @@ test.describe("UserFront WASM auth routing", () => {
expect(approvedRef).toBe("e2e-approve-ref");
});
test('verifyOnly 승인 완료 화면의 상단 액션은 signin으로 복귀시킨다', async ({
test("verifyOnly 승인 완료 화면의 상단 액션은 signin으로 복귀시킨다", async ({
page,
}) => {
let userMeCalls = 0;
@@ -317,10 +308,9 @@ test.describe("UserFront WASM auth routing", () => {
expect(userMeCalls).toBe(0);
expect(
clientFailures.filter(
(failure) => !failure.includes('401 (Unauthorized)'),
(failure) => !failure.includes("401 (Unauthorized)"),
),
).toEqual([]);
});
test("verifyOnly 승인 완료 버튼은 SMS 링크에서 로그인 창으로 이동하고 user/me 조회를 만들지 않는다", async ({
@@ -359,7 +349,7 @@ test.describe("UserFront WASM auth routing", () => {
).toEqual([]);
});
test('verifyOnly 원격 승인 완료는 로그인 창 이동 CTA와 안내 문구를 표시한다', async ({
test("verifyOnly 원격 승인 완료는 로그인 창 이동 CTA와 안내 문구를 표시한다", async ({
page,
}) => {
let verifyCalls = 0;
@@ -417,10 +407,10 @@ test.describe("UserFront WASM auth routing", () => {
"/?loginId=e2e%40example.com&code=654321&pendingRef=pending-root&utm=drop",
);
await expect.poll(() => verifyRequests.length, { timeout: 10_000 }).toBe(1);
await expect.poll(() => page.url(), { timeout: 10_000 }).toContain(
'/ko/verify-complete',
);
expect(verifyRequests[0].path).toContain('/api/v1/auth/login/code/verify');
await expect
.poll(() => page.url(), { timeout: 10_000 })
.toContain("/ko/verify-complete");
expect(verifyRequests[0].path).toContain("/api/v1/auth/login/code/verify");
expect(verifyRequests[0].body).toMatchObject({
loginId: "e2e@example.com",
code: "654321",
@@ -431,6 +421,7 @@ test.describe("UserFront WASM auth routing", () => {
expect(page.url()).not.toContain("code=");
expect(page.url()).not.toContain("pendingRef=");
expect(page.url()).not.toContain("utm=");
expect(userMeCalls).toBe(0);
expect(clientFailures).toEqual([]);
});
@@ -456,14 +447,15 @@ test.describe("UserFront WASM auth routing", () => {
await page.goto("/ko/signin?loginId=e2e%40example.com&code=999999");
await expect.poll(() => verifyRequests.length, { timeout: 10_000 }).toBe(1);
await expect.poll(() => page.url(), { timeout: 10_000 }).toContain(
'/ko/verify-complete',
);
await expect
.poll(() => page.url(), { timeout: 10_000 })
.toContain("/ko/verify-complete");
expect(verifyRequests[0].body).toMatchObject({
loginId: "e2e@example.com",
code: "999999",
verifyOnly: true,
});
expect(userMeCalls).toBe(0);
expect(page.url()).not.toContain("loginId=");
expect(page.url()).not.toContain("code=");
expect(clientFailures).toEqual([]);
@@ -552,7 +544,7 @@ test.describe("UserFront WASM auth routing", () => {
await page.goto("/ko/verify/e2e-email-token");
await expect.poll(() => verifyRequests.length, { timeout: 10_000 }).toBe(1);
expect(verifyRequests[0].path).toContain('/api/v1/auth/magic-link/verify');
expect(verifyRequests[0].path).toContain("/api/v1/auth/magic-link/verify");
expect(verifyRequests[0].body).toMatchObject({
token: "e2e-email-token",
verifyOnly: true,
@@ -592,7 +584,7 @@ test.describe("UserFront WASM auth routing", () => {
);
await expect.poll(() => verifyRequests.length, { timeout: 10_000 }).toBe(1);
expect(verifyRequests[0].path).toContain('/api/v1/auth/login/code/verify');
expect(verifyRequests[0].path).toContain("/api/v1/auth/login/code/verify");
expect(verifyRequests[0].body).toMatchObject({
loginId: "e2e@example.com",
code: "654321",