import { expect, test } from "@playwright/test"

test.describe("auth smoke", () => {
  test("login page renders required controls", async ({ page }) => {
    await page.goto("/login")
    await expect(page).toHaveTitle(/Login/i)
    await expect(page.getByLabel("Email")).toBeVisible()
    await expect(page.getByLabel("Password")).toBeVisible()
    await expect(page.getByRole("button", { name: "Sign In with Email" })).toBeVisible()
  })

  test("register page renders required controls", async ({ page }) => {
    await page.goto("/register")
    await expect(page).toHaveTitle(/Register/i)
    // 注册表单当前使用中文文案；P1 i18n 阶段会切换为 next-intl 翻译键，
    // 届时此处的选择器应改用 data-testid 或 i18n 键以确保语言无关。
    await expect(page.getByLabel("姓名")).toBeVisible()
    await expect(page.getByLabel("邮箱")).toBeVisible()
    await expect(page.getByLabel("密码")).toBeVisible()
    await expect(page.getByRole("button", { name: "创建账户" })).toBeVisible()
  })
})

