test(ui): pin the filter chip safety net for unknown model group deep links

A stale or unknown ?model_group= value exact-matches nothing, so the
table is empty; what makes that safe is the toolbar filter chip, which
shows the raw value and clears both the filter and the URL param.
Greptile flagged the empty table as having no visible active filter,
which the chip disproves; this test keeps it that way
This commit is contained in:
ryan-crabbe-berri 2026-07-29 12:00:08 -07:00
parent da439f7b70
commit 9bbccd57bd

View file

@ -263,6 +263,21 @@ describe("AllModelsTab", () => {
expect(within(table).queryByText("gpt-4")).not.toBeInTheDocument();
});
it("keeps an unknown model group (for example a stale deep link) visible as a removable filter chip", async () => {
const user = userEvent.setup();
setModelsInfo([makeRow()], 1);
render(<AllModelsTab {...defaultProps} selectedModelGroup="stale-deleted-model" />);
expect(screen.getByTestId("filter-chip-model_name")).toHaveTextContent("stale-deleted-model");
expect(screen.getByText("No models found")).toBeInTheDocument();
await user.click(screen.getByTestId("filter-chip-remove-model_name"));
await waitFor(() => {
expect(mockSetSelectedModelGroup).toHaveBeenCalledWith("all");
});
});
it("resets search, filters, team and sorting from the drawer reset button", async () => {
const user = userEvent.setup();
render(<AllModelsTab {...defaultProps} selectedModelGroup="gpt-4" />);