mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
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:
parent
da439f7b70
commit
9bbccd57bd
1 changed files with 15 additions and 0 deletions
|
|
@ -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" />);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue