import { test, expect } from "vitest"; import { render, screen } from "@testing-library/react"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select"; test("the trigger clips a long selected value instead of letting it spill out of the box", () => { render( , ); const trigger = screen.getByRole("combobox", { name: "Pick" }); // `flex` on the value span overrides line-clamp's display, so the clamp alone never clipped anything. // The `*:data-[slot=...]` form compiles inside out under Tailwind 3 and never matched the span. expect(trigger.className).toContain("[&>[data-slot=select-value]]:min-w-0"); expect(trigger.className).toContain("[&>[data-slot=select-value]]:overflow-hidden"); });