Google 로그인을 단일 버튼으로 정리
This commit is contained in:
parent
7994175a3d
commit
471eb9621a
15 changed files with 78 additions and 85 deletions
|
|
@ -24,7 +24,7 @@ import { completeOnboarding, expectNoHorizontalOverflow, useRealApi } from "./su
|
|||
const CONFIG_PATTERN = "**/api/auth/config";
|
||||
const ME_PATTERN = "**/api/auth/me";
|
||||
|
||||
/** 로컬 redirect_uri라서 두 OAuth 버튼이 모두 활성화되는 구성 fixture. */
|
||||
/** 로컬 redirect_uri라서 단일 Google OAuth 버튼이 활성화되는 구성 fixture. */
|
||||
const READY_AUTH_CONFIG = {
|
||||
google_oauth_configured: true,
|
||||
saml_configured: false,
|
||||
|
|
@ -153,7 +153,7 @@ test.describe("full sweep auth", () => {
|
|||
});
|
||||
|
||||
// 검증 checklist: auth-login-generic-google-button
|
||||
test("both Google buttons advertise unrestricted accounts and start the same OAuth flow", async ({
|
||||
test("single Google button advertises unrestricted accounts and starts the account chooser flow", async ({
|
||||
page,
|
||||
}) => {
|
||||
await mockUnauthenticatedMe(page);
|
||||
|
|
@ -173,16 +173,16 @@ test.describe("full sweep auth", () => {
|
|||
});
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
const secondary = page.locator(".lg-obtn.secondary");
|
||||
await expect(secondary).toBeEnabled();
|
||||
await expect(secondary).toContainText("다른 Google 계정 선택");
|
||||
await expect(secondary.locator(".sub")).toHaveText("이메일 확인 후 바로 시작");
|
||||
await expect(page.locator(".lg-obtn.primary .sub")).toHaveText("모든 Google 계정");
|
||||
const googleLogin = page.getByRole("button", { name: /^Google 계정으로 로그인/ });
|
||||
await expect(googleLogin).toHaveCount(1);
|
||||
await expect(googleLogin).toBeEnabled();
|
||||
await expect(googleLogin.locator(".sub")).toHaveText("모든 Google 계정");
|
||||
await expect(page.getByRole("button", { name: /다른 Google 계정 선택/ })).toHaveCount(0);
|
||||
|
||||
// 클릭 시 primary와 동일한 provider=google 시작 URL로 이동한다.
|
||||
// 단일 CTA가 provider=google OAuth 시작 URL로 이동한다.
|
||||
await Promise.all([
|
||||
page.waitForURL(/\/api\/auth\/login\?provider=google&next=%2F/),
|
||||
secondary.click(),
|
||||
googleLogin.click(),
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue