test(admin): cover pages and navigation form components
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/* @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()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user