import { expect, test } from "vitest";

import { rowStateClass, segmentClass } from "./class-recipes";

test("segmentClass active uses the primary tokens + focus ring", () => {
  const cls = segmentClass(true, "px-2 py-1");
  expect(cls).toContain("bg-primary");
  expect(cls).toContain("text-primary-foreground");
  expect(cls).toContain("focus-visible:ring-ring/50");
  expect(cls).toContain("px-2");
});

test("segmentClass inactive uses border, not the primary fill", () => {
  const cls = segmentClass(false);
  expect(cls).toContain("border");
  expect(cls).not.toContain("bg-primary");
});

test("rowStateClass toggles selected vs idle-hover", () => {
  expect(rowStateClass(true)).toBe("bg-primary/10");
  expect(rowStateClass(false)).toBe("hover:bg-muted");
});
