현재 작업 전체 반영
This commit is contained in:
parent
5560638e54
commit
c0dddab594
85 changed files with 11322 additions and 539 deletions
|
|
@ -69,10 +69,8 @@ test.describe("auth domain policy", () => {
|
|||
const googleButtons = page.locator(".lg-obtn");
|
||||
await expect(googleButtons).toHaveCount(2);
|
||||
await expect(page.locator(".lg-policy b")).toContainText(config.allowed_email_domains);
|
||||
const currentHost = new URL(page.url()).hostname;
|
||||
const redirectHost = new URL(config.redirect_uri).hostname;
|
||||
const localOAuthUnavailable =
|
||||
isLocalHostname(currentHost) &&
|
||||
const devOAuthUnavailable =
|
||||
config.dev_login_enabled &&
|
||||
!isLocalHostname(redirectHost);
|
||||
if (config.dev_login_enabled) {
|
||||
|
|
@ -81,7 +79,7 @@ test.describe("auth domain policy", () => {
|
|||
await expect(page.locator(".lg-dev")).toHaveCount(0);
|
||||
}
|
||||
|
||||
if (config.google_oauth_configured && !localOAuthUnavailable) {
|
||||
if (config.google_oauth_configured && !devOAuthUnavailable) {
|
||||
await expect(googleButtons.first()).toBeEnabled();
|
||||
await expect(page.locator(".lg-config")).toHaveCount(0);
|
||||
} else {
|
||||
|
|
@ -91,8 +89,11 @@ test.describe("auth domain policy", () => {
|
|||
await expect(page).toHaveURL(/\/login$/);
|
||||
await expect(page.locator("body")).not.toContainText("Google OAuth is not configured");
|
||||
|
||||
if (localOAuthUnavailable) {
|
||||
if (devOAuthUnavailable) {
|
||||
await expect(page.locator(".lg-config")).toContainText("로컬 테스트 계정으로 로그인");
|
||||
await page.goto("/api/auth/login?provider=google&next=%2Flearn");
|
||||
await expect(page).toHaveURL(/\/login\?oauth=local_oauth_unavailable$/);
|
||||
await expect(page.locator(".lg-error")).toContainText("로컬 개발 주소에서는 Google OAuth");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +104,14 @@ test.describe("auth domain policy", () => {
|
|||
}
|
||||
});
|
||||
|
||||
test("shows the concrete OAuth failure reason on the login screen", async ({ page }) => {
|
||||
await page.goto("/login?oauth=provider_error");
|
||||
const error = page.locator(".lg-error");
|
||||
|
||||
await expect(error).toContainText("Google이 인증 코드를 발급하지 못했습니다");
|
||||
await expect(error).toContainText("오류 코드: provider_error");
|
||||
});
|
||||
|
||||
test("logs in locally with the server dev session and redirects to learner home", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue