From 9bbccd57bd47f40c82bfaf57e64e751976102dce Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Wed, 29 Jul 2026 12:00:08 -0700 Subject: [PATCH] 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 --- .../components/AllModelsTab.test.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx index 659a618c8f6..6891082b47e 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx @@ -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(); + + 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();