Google 로그인을 단일 버튼으로 정리

This commit is contained in:
Yun Chan 2026-08-29 06:54:11 +09:00
parent 7994175a3d
commit 471eb9621a
15 changed files with 78 additions and 85 deletions

View file

@ -67,13 +67,17 @@ test.describe("auth domain policy", () => {
await page.goto("/login");
const googleButtons = page.locator(".lg-obtn");
await expect(googleButtons).toHaveCount(2);
await expect(googleButtons).toHaveCount(1);
await expect(page.getByRole("button", { name: /^Google 계정으로 로그인/ })).toHaveCount(1);
await expect(page.getByRole("button", { name: /다른 Google 계정 선택/ })).toHaveCount(0);
expect(config.allowed_email_domains).toEqual([]);
await expect(page.locator(".lg-policy b")).toHaveText("모든 Google 계정");
const redirectHost = new URL(config.redirect_uri).hostname;
const devOAuthUnavailable =
config.dev_login_enabled &&
!isLocalHostname(redirectHost);
await expect(page.locator(".lg-policy b")).toHaveText(
config.google_oauth_configured && !devOAuthUnavailable ? "모든 Google 계정" : "설정 필요",
);
if (config.dev_login_enabled) {
await expect(page.locator(".lg-dev")).toBeVisible();
} else {
@ -85,7 +89,6 @@ test.describe("auth domain policy", () => {
await expect(page.locator(".lg-config")).toHaveCount(0);
} else {
await expect(googleButtons.first()).toBeDisabled();
await expect(googleButtons.nth(1)).toBeDisabled();
await expect(page.locator(".lg-config")).toBeVisible();
await expect(page).toHaveURL(/\/login$/);
await expect(page.locator("body")).not.toContainText("Google OAuth is not configured");
@ -239,7 +242,9 @@ test.describe("auth domain policy", () => {
await page.goto(`${publicBase}/login`, { waitUntil: "domcontentloaded" });
await page.waitForLoadState("networkidle", { timeout: 15_000 }).catch(() => undefined);
await expect(page.locator(".lg-obtn")).toHaveCount(2);
await expect(page.locator(".lg-obtn")).toHaveCount(1);
await expect(page.getByRole("button", { name: /^Google 계정으로 로그인/ })).toHaveCount(1);
await expect(page.getByRole("button", { name: /다른 Google 계정 선택/ })).toHaveCount(0);
await expect(page.locator(".lg-dev")).toHaveCount(0);
await expect(page.getByText("로컬 테스트")).toHaveCount(0);
await expect(page.getByText("로컬 테스트 계정으로 계속")).toHaveCount(0);