import { describe, expect, it } from "vitest";
import { AccordionRootPropsSchema, AccordionMeta } from "../../src/components/accordion/accordion.props";
import { CollapsibleRootPropsSchema, CollapsibleMeta } from "../../src/components/collapsible/collapsible.props";
import { AlertDialogRootPropsSchema, AlertDialogMeta } from "../../src/components/alert-dialog/alert-dialog.props";
import { BreadcrumbsRootPropsSchema, BreadcrumbsMeta } from "../../src/components/breadcrumbs/breadcrumbs.props";
import { TabsRootPropsSchema, TabsMeta } from "../../src/components/tabs/tabs.props";
describe("Disclosure component schemas", () => {
  it("Accordion validates", () => {
    expect(AccordionRootPropsSchema.safeParse({ value: "item-1" }).success).toBe(true);
    expect(AccordionRootPropsSchema.safeParse({ value: ["item-1", "item-2"], multiple: true }).success).toBe(true);
  });
  it("Collapsible validates", () => { expect(CollapsibleRootPropsSchema.safeParse({ open: true, disabled: false }).success).toBe(true); });
  it("AlertDialog validates", () => { expect(AlertDialogRootPropsSchema.safeParse({ open: false }).success).toBe(true); });
  it("Breadcrumbs validates", () => { expect(BreadcrumbsRootPropsSchema.safeParse({ separator: ">" }).success).toBe(true); });
  it("Tabs validates", () => {
    expect(TabsRootPropsSchema.safeParse({ value: "tab1", orientation: "vertical", activationMode: "manual" }).success).toBe(true);
    expect(TabsRootPropsSchema.safeParse({ orientation: "diagonal" }).success).toBe(false);
  });
  it("all Meta objects valid", () => {
    const metas = [AccordionMeta, CollapsibleMeta, AlertDialogMeta, BreadcrumbsMeta, TabsMeta];
    for (const meta of metas) {
      expect(meta.name).toBeTruthy();
      expect(meta.description).toBeTruthy();
      expect(meta.parts.length).toBeGreaterThan(0);
      expect(meta.requiredParts.length).toBeGreaterThan(0);
    }
  });
});
