From 4891c178ae71f98438fd5f79e9530760beaddb57 Mon Sep 17 00:00:00 2001 From: vismaytiwari Date: Sat, 27 Jun 2026 23:26:53 +0530 Subject: [PATCH] test(ui): strengthen usage indicator position check --- .../src/components/UsageIndicator.test.tsx | 7 ++++--- ui/litellm-dashboard/src/components/UsageIndicator.tsx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/litellm-dashboard/src/components/UsageIndicator.test.tsx b/ui/litellm-dashboard/src/components/UsageIndicator.test.tsx index bd25ef185d3..b56d65fc12d 100644 --- a/ui/litellm-dashboard/src/components/UsageIndicator.test.tsx +++ b/ui/litellm-dashboard/src/components/UsageIndicator.test.tsx @@ -41,11 +41,12 @@ describe("UsageIndicator", () => { }); it("should not use fixed positioning that can cover sidebar items", async () => { - render(); + const { container } = render(); - const usageLabel = await screen.findByText("Usage"); + await screen.findByText("Usage"); - expect(usageLabel.closest(".fixed")).toBeNull(); + expect(container.firstElementChild).not.toHaveClass("fixed"); + expect(container.firstElementChild).not.toHaveStyle({ position: "fixed" }); }); it("should not show Near limit when users usage is below 80% (1/100 -> 1%)", async () => { diff --git a/ui/litellm-dashboard/src/components/UsageIndicator.tsx b/ui/litellm-dashboard/src/components/UsageIndicator.tsx index 3c6f6c793ac..a786a9e5cef 100644 --- a/ui/litellm-dashboard/src/components/UsageIndicator.tsx +++ b/ui/litellm-dashboard/src/components/UsageIndicator.tsx @@ -688,7 +688,7 @@ export default function UsageIndicator({ accessToken, width = 220 }: UsageIndica } return ( -
+
);