/* @vitest-environment jsdom */

import { render, screen } from "@testing-library/react"
import { describe, expect, it, vi } from "vitest"

import { CreateMenuForm } from "./create-menu-form"

describe("CreateMenuForm", () => {
  it("renders defaults for location and visibility", () => {
    render(<CreateMenuForm action={vi.fn()} />)

    const location = screen.getByLabelText("Location") as HTMLInputElement
    expect(location.value).toBe("primary")

    const visible = screen.getByLabelText("Visible") as HTMLInputElement
    expect(visible.checked).toBe(true)

    expect(screen.getByRole("button", { name: "Create menu" })).not.toBeNull()
  })
})
