Feat: 로그인 여부에 따른 메인페이지 이동 및 dashboard 처리

This commit is contained in:
2026-02-05 16:36:42 +09:00
parent ded49b5e2a
commit f1e340d9f1
17 changed files with 497 additions and 73 deletions

29
tests/e2e/auth.spec.ts Normal file
View File

@@ -0,0 +1,29 @@
import { test, expect } from "@playwright/test";
test.describe("Authentication Flow", () => {
test("Guest should see Landing Page", async ({ page }) => {
await page.goto("/");
await expect(page).toHaveTitle(/AutoTrade/i);
await expect(
page.getByRole("heading", { name: "투자의 미래, 자동화하세요" }),
).toBeVisible();
await expect(
page.getByRole("link", { name: "로그인" }).first(),
).toBeVisible();
});
test("Guest trying to access /dashboard should be redirected to /login", async ({
page,
}) => {
await page.goto("/dashboard");
await expect(page).toHaveURL(/\/login/);
await expect(page.getByRole("button", { name: "로그인" })).toBeVisible();
});
test("Login page should load correctly", async ({ page }) => {
await page.goto("/login");
await expect(page.getByLabel("이메일", { exact: true })).toBeVisible();
await expect(page.getByLabel("비밀번호")).toBeVisible();
await expect(page.getByRole("button", { name: "로그인" })).toBeVisible();
});
});