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 6378e88c10a..4d0b1c466a4 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 @@ -9,6 +9,7 @@ import { STATUS_COLUMN_ID, toServerSortField } from "./ModelsTableColumns"; const mockModelDeleteCall = vi.fn().mockResolvedValue({}); const mockModelPatchUpdateCall = vi.fn().mockResolvedValue({}); vi.mock("@/components/networking", () => ({ + serverRootPath: "/", modelDeleteCall: (...args: unknown[]) => mockModelDeleteCall(...args), modelPatchUpdateCall: (...args: unknown[]) => mockModelPatchUpdateCall(...args), })); @@ -335,6 +336,23 @@ describe("AllModelsTab", () => { expect(screen.getByText(/create a Virtual Key without selecting a team/i)).toBeInTheDocument(); }); + it("links the Virtual Keys page through the migrated /ui route", () => { + render(); + + expect(screen.getByRole("link", { name: "Virtual Keys page" })).toHaveAttribute("href", "/ui/api-keys"); + }); + + it("links the team hint's Virtual Keys page through the migrated /ui route", async () => { + const user = userEvent.setup(); + render(); + + await user.click(screen.getByTestId("models-team-select")); + await user.click(await screen.findByRole("option", { name: "Engineering" })); + + await screen.findByText(/select Team as "Engineering"/i); + expect(screen.getByRole("link", { name: "Virtual Keys page" })).toHaveAttribute("href", "/ui/api-keys"); + }); + it("names the selected team in the hint", async () => { const user = userEvent.setup(); render(); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx index d82e8b60c13..1a9d33a50bc 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx @@ -7,6 +7,7 @@ import DeleteResourceModal from "@/components/common_components/DeleteResourceMo import ModelSettingsModal from "@/components/model_dashboard/ModelSettingsModal/ModelSettingsModal"; import { ModelData } from "@/components/model_dashboard/types"; import { toast } from "@/lib/toast"; +import { migratedHref } from "@/utils/migratedPages"; import { modelDeleteCall, modelPatchUpdateCall } from "@/components/networking"; import { useQueryClient } from "@tanstack/react-query"; import { useDebouncedCallback } from "@tanstack/react-pacer/debouncer"; @@ -301,7 +302,7 @@ const AllModelsTab = ({ {selectedTeamValue === PERSONAL_TEAM_VALUE ? ( To access these models, create a Virtual Key without selecting a team on the{" "} - + Virtual Keys page . @@ -309,7 +310,7 @@ const AllModelsTab = ({ ) : ( To access these models, create a Virtual Key and select Team as "{teamAccessLabel}" on the{" "} - + Virtual Keys page .