import { describe, expect, it } from "vitest";
import { TooltipRootPropsSchema, TooltipMeta } from "../../src/components/tooltip/tooltip.props";
import { PopoverRootPropsSchema, PopoverMeta } from "../../src/components/popover/popover.props";
import { HoverCardRootPropsSchema, HoverCardMeta } from "../../src/components/hover-card/hover-card.props";
import { DrawerRootPropsSchema, DrawerMeta } from "../../src/components/drawer/drawer.props";
import { ToastRegionPropsSchema, ToastMeta } from "../../src/components/toast/toast.props";
const ok = (schema: { safeParse: (v: unknown) => { success: boolean } }, v: unknown) => schema.safeParse(v).success;
describe("Overlay component schemas", () => {
  it("Tooltip validates delays", () => { expect(ok(TooltipRootPropsSchema, { openDelay: 500, closeDelay: 200 })).toBe(true); });
  it("Popover validates modal", () => { expect(ok(PopoverRootPropsSchema, { open: true, modal: true })).toBe(true); });
  it("HoverCard validates delays", () => { expect(ok(HoverCardRootPropsSchema, { openDelay: 300 })).toBe(true); });
  it("Drawer validates side enum", () => {
    expect(ok(DrawerRootPropsSchema, { side: "left" })).toBe(true);
    expect(ok(DrawerRootPropsSchema, { side: "center" })).toBe(false);
  });
  it("Toast validates placement", () => {
    expect(ok(ToastRegionPropsSchema, { placement: "top-center", duration: 3000, limit: 5 })).toBe(true);
    expect(ok(ToastRegionPropsSchema, { placement: "middle" })).toBe(false);
  });
  it("all Meta objects valid", () => {
    for (const meta of [TooltipMeta, PopoverMeta, HoverCardMeta, DrawerMeta, ToastMeta]) {
      expect(meta.name).toBeTruthy();
      expect(meta.description).toBeTruthy();
      expect(meta.parts.length).toBeGreaterThan(0);
      expect(meta.requiredParts.length).toBeGreaterThan(0);
    }
  });
});
