The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(ui): share one chart bar lookup across Top Virtual Keys tests
ryan-crabbe-berri82fd632153f6
diff --git a/ui/litellm-dashboard/src/components/UsagePage/components/EntityUsage/TopKeyView.test.tsx b/ui/litellm-dashboard/src/components/UsagePage/components/EntityUsage/TopKeyView.test.tsxindex e1d64ab03bd..e65094c5228 100644--- a/ui/litellm-dashboard/src/components/UsagePage/components/EntityUsage/TopKeyView.test.tsx+++ b/ui/litellm-dashboard/src/components/UsagePage/components/EntityUsage/TopKeyView.test.tsx@@ -29,6 +29,8 @@ vi.mock("../../../templates/key_info_view", () => ({),}));+const chartBars = (container: HTMLElement) => Array.from(container.querySelectorAll("path.recharts-rectangle"));+describe("TopKeyView", () => {const mockUseAuthorized = vi.mocked(useAuthorized);const mockKeyInfoV1Call = vi.mocked(networking.keyInfoV1Call);@@ -206,7 +208,7 @@ describe("TopKeyView", () => {await user.click(screen.getByRole("button", { name: "Chart View" }));- const bars = container.querySelectorAll("path.recharts-rectangle");+ const bars = chartBars(container);expect(bars).toHaveLength(1);expect(bars[0]).toHaveAttribute("fill", "var(--color-cyan-500, #06b6d4)");expect(screen.getAllByText("A Very Lon...").length).toBeGreaterThan(0);@@ -511,7 +513,7 @@ describe("TopKeyView", () => {await user.click(screen.getByText("session-key"));await user.click(screen.getByRole("button", { name: "Chart View" }));- const bars = container.querySelectorAll("path.recharts-rectangle");+ const bars = chartBars(container);expect(bars).toHaveLength(2);bars.forEach((bar) => fireEvent.click(bar));