mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
test(ui): pin the clock in the per-user export filename test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
86a019128e
commit
49126d4434
1 changed files with 4 additions and 3 deletions
|
|
@ -2234,12 +2234,13 @@ describe("EntityUsageExport utils", () => {
|
|||
it("should generate the daily_with_users filename and include User ID in the rows", () => {
|
||||
const anchorElement = document.createElement("a");
|
||||
vi.spyOn(document, "createElement").mockReturnValue(anchorElement);
|
||||
|
||||
const today = new Date().toISOString().split("T")[0];
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date("2025-03-01T12:00:00Z"));
|
||||
|
||||
handleExportCSV(usersFixture, "daily_with_users", "Team", "team", mockTeamAliasMap);
|
||||
vi.useRealTimers();
|
||||
|
||||
expect(anchorElement.download).toBe(`team_usage_daily_with_users_${today}.csv`);
|
||||
expect(anchorElement.download).toBe("team_usage_daily_with_users_2025-03-01.csv");
|
||||
|
||||
const unparsedRows = vi.mocked(Papa.unparse).mock.calls[0][0] as Record<string, unknown>[];
|
||||
expect(unparsedRows[0]).toHaveProperty("User ID");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue