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.
This commit is contained in:
ryan-crabbe-berri 2026-06-19 12:56:38 -07:00
parent db1ea2d588
commit cbc272eea1

View file

@ -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 () => {