mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
fix(ui): link Virtual Keys hint through the migrated /ui route
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
eb0e3f8c18
commit
3ec3933c1f
2 changed files with 21 additions and 2 deletions
|
|
@ -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(<AllModelsTab {...defaultProps} />);
|
||||
|
||||
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(<AllModelsTab {...defaultProps} />);
|
||||
|
||||
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(<AllModelsTab {...defaultProps} />);
|
||||
|
|
|
|||
|
|
@ -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 ? (
|
||||
<span>
|
||||
To access these models, create a Virtual Key without selecting a team on the{" "}
|
||||
<a href="/public?login=success&page=api-keys" className="font-medium text-info hover:underline">
|
||||
<a href={migratedHref("api-keys")} className="font-medium text-info hover:underline">
|
||||
Virtual Keys page
|
||||
</a>
|
||||
.
|
||||
|
|
@ -309,7 +310,7 @@ const AllModelsTab = ({
|
|||
) : (
|
||||
<span>
|
||||
To access these models, create a Virtual Key and select Team as "{teamAccessLabel}" on the{" "}
|
||||
<a href="/public?login=success&page=api-keys" className="font-medium text-info hover:underline">
|
||||
<a href={migratedHref("api-keys")} className="font-medium text-info hover:underline">
|
||||
Virtual Keys page
|
||||
</a>
|
||||
.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue