import { resolve } from "node:path";
import { describe, expect, it, vi, afterEach } from "vitest";
import { render, fireEvent, cleanup } from "@testing-library/preact";
import { Nav } from "./Nav.js";
const sampleItems = [
{ label: "Home", href: "/", active: true },
{ label: "About", href: "/about" },
{ label: "Contact", href: "/contact" },
];
describe("Nav", () => {
afterEach(() => {
document.body.classList.remove("strand-glass-nav-active");
cleanup();
});
// ── Glass nav body class management ──
// ── Rendering ──
it("renders a nav element", () => {
const { container } = render();
expect(container.querySelector("nav")).toBeTruthy();
});
it("has aria-label Main navigation", () => {
const { getByRole } = render();
expect(getByRole("navigation")).toHaveAttribute(
"aria-label",
"Main navigation",
);
});
it("renders logo content", () => {
const { getByText } = render(