mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
test(ui): clear localStorage between UsagePageView test cases
UsagePageView now persists the selected usage view, activity tab, and date range to localStorage. Without resetting it in beforeEach, state written by one test (switching to "tag" view, a different tab, etc.) leaked into every test that ran after it in the same file, since vitest doesn't reset localStorage between tests automatically.
This commit is contained in:
parent
d1c3e7bcc5
commit
547c5397ca
1 changed files with 4 additions and 0 deletions
|
|
@ -539,6 +539,10 @@ describe("UsagePage", () => {
|
|||
};
|
||||
|
||||
beforeEach(() => {
|
||||
// UsagePageView now persists the selected view/tab/date-range to
|
||||
// localStorage; without clearing it here, whichever test runs first
|
||||
// pollutes every test after it in this file.
|
||||
localStorage.clear();
|
||||
mockUseAuthorized.mockReturnValue({
|
||||
isLoading: false,
|
||||
isAuthorized: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue