Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,30 @@ describe("AllModelsTable", () => {
expect(onTeamChange).toHaveBeenCalledWith("team-1");
});

it("truncates long team options instead of clipping them at the popup edge", async () => {
const user = userEvent.setup();
const longLabel = "db29687d-0ca2-4bbe-a0f1-9c5f0f7c2a11";
render(
<AllModelsTable
{...baseProps}
teamOptions={[
{ value: "personal", label: "Personal" },
{ value: "team-long", label: longLabel },
]}
/>,
);

await user.click(screen.getByTestId("models-team-select"));

const option = await screen.findByRole("option", { name: longLabel });
const label = option.querySelector("[data-slot='select-item-label']");

expect(label).not.toBeNull();
expect(label).toHaveClass("truncate");
expect(label).toHaveAttribute("title", longLabel);
expect(option).toHaveClass("[&>div]:min-w-0");
});

it("runs the full reset from the filter drawer", async () => {
const user = userEvent.setup();
const onResetFilters = vi.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,15 @@ export function AllModelsTable({
</SelectTrigger>
<SelectContent>
{teamOptions.map((option) => (
<SelectItem key={option.value} value={option.value} disabled={isLoadingTeams}>
{option.label}
<SelectItem
key={option.value}
value={option.value}
disabled={isLoadingTeams}
className="[&>div]:min-w-0"
>
<span data-slot="select-item-label" className="min-w-0 truncate" title={option.label}>
{option.label}
</span>
</SelectItem>
))}
</SelectContent>
Expand Down
Loading