From cbc272eea162bd3ac9c70ce1aa9d24df66bf0b49 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Fri, 19 Jun 2026 12:56:38 -0700 Subject: [PATCH] test(ui): assert exactly one viewport-bounded scroll container in key detail panel Tighten the regression guard so it cannot match an inner scroller: filter the overflow-y-auto elements down to the one carrying max-h-[85vh] and assert there is exactly one. Still fails if the bound is removed. --- .../src/components/templates/key_info_view.test.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/components/templates/key_info_view.test.tsx b/ui/litellm-dashboard/src/components/templates/key_info_view.test.tsx index 5fbcf3daafe..c6394fd98c1 100644 --- a/ui/litellm-dashboard/src/components/templates/key_info_view.test.tsx +++ b/ui/litellm-dashboard/src/components/templates/key_info_view.test.tsx @@ -176,9 +176,10 @@ describe("KeyInfoView", () => { />, ); - const scrollContainer = container.querySelector(".overflow-y-auto"); - expect(scrollContainer).not.toBeNull(); - expect(scrollContainer!.className).toContain("max-h-[85vh]"); + const boundedScrollContainers = Array.from(container.querySelectorAll(".overflow-y-auto")).filter((el) => + el.classList.contains("max-h-[85vh]"), + ); + expect(boundedScrollContainers).toHaveLength(1); }); it("should not render tags in metadata textarea", async () => {