mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-15 04:19:08 +00:00
test(ui): strengthen usage indicator position check
This commit is contained in:
parent
7a79b3e301
commit
4891c178ae
2 changed files with 5 additions and 4 deletions
|
|
@ -41,11 +41,12 @@ describe("UsageIndicator", () => {
|
|||
});
|
||||
|
||||
it("should not use fixed positioning that can cover sidebar items", async () => {
|
||||
render(<UsageIndicator accessToken="token" width={220} />);
|
||||
const { container } = render(<UsageIndicator accessToken="token" width={220} />);
|
||||
|
||||
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 () => {
|
||||
|
|
|
|||
|
|
@ -688,7 +688,7 @@ export default function UsageIndicator({ accessToken, width = 220 }: UsageIndica
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="px-4 py-2" style={{ boxSizing: "border-box", width: `${Math.min(width, 220)}px` }}>
|
||||
<div className="px-4 py-2" style={{ width: `${Math.min(width, 220)}px` }}>
|
||||
<CardStyleView />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue