Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 5 additions & 58 deletions ui/litellm-dashboard/eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,13 @@
"src/app/(dashboard)/caching/_components/cache_health.tsx": {
"local/filename-pascal-case": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/caching/_components/cache_settings/CacheFormField.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/caching/_components/cache_settings/RedisTypeSelector.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/caching/_components/cache_settings/cacheSettingsFields.ts": {
"no-restricted-imports": {
"count": 1
Expand All @@ -213,11 +205,6 @@
"count": 1
}
},
"src/app/(dashboard)/caching/_components/coordination_redis_settings/CoordinationRedisTypeSelector.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/caching/_components/coordination_redis_settings/coordinationRedisFields.ts": {
"no-restricted-imports": {
"count": 1
Expand Down Expand Up @@ -1469,9 +1456,6 @@
"no-nested-ternary": {
"count": 10
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/immutability": {
"count": 1
}
Expand All @@ -1483,9 +1467,6 @@
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
Expand All @@ -1509,9 +1490,6 @@
"src/app/(dashboard)/policies/_components/impact_preview_alert.tsx": {
"local/filename-pascal-case": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/index.test.tsx": {
Expand All @@ -1526,9 +1504,6 @@
"local/no-complex-jsx-arrow": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
Expand All @@ -1543,9 +1518,6 @@
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 2
}
Expand All @@ -1554,19 +1526,13 @@
"local/filename-pascal-case": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_templates.tsx": {
"local/filename-pascal-case": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_test_panel.tsx": {
Expand All @@ -1584,9 +1550,6 @@
"local/filename-pascal-case": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/immutability": {
"count": 1
},
Expand Down Expand Up @@ -2218,26 +2181,11 @@
"count": 1
}
},
"src/components/CloudZeroCostTracking/CloudZeroCostTracking.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/components/CloudZeroCostTracking/CloudZeroCreateModal.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/components/CloudZeroCostTracking/CloudZeroEmptyPlaceholder.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/components/CloudZeroCostTracking/CloudZeroIntegrationSettings.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/components/CloudZeroCostTracking/CloudZeroUpdateModal.tsx": {
"no-restricted-imports": {
"count": 1
Expand Down Expand Up @@ -3240,9 +3188,6 @@
"local/filename-pascal-case": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/immutability": {
"count": 1
}
Expand All @@ -3251,9 +3196,6 @@
"local/filename-pascal-case": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"prefer-const": {
"count": 1
}
Expand Down Expand Up @@ -4116,6 +4058,11 @@
"count": 1
}
},
"src/components/ui/radio-group.tsx": {
"local/filename-pascal-case": {
"count": 1
}
},
"src/components/ui/scroll-area.tsx": {
"local/filename-pascal-case": {
"count": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,23 @@ const renderDashboard = () =>
<CacheDashboard accessToken="sk-test" token="tok" userRole="Admin" userID="u1" premiumUser={false} />,
);

const REQUESTS_CHART_TITLE = "Cache Hits vs API Requests";
const TOKENS_CHART_TITLE = "Cached Completion Tokens vs Generated Completion Tokens";

// Anchored on each chart's own title rather than on a global card count, so
// adding cards elsewhere on the page cannot silently repoint these assertions.
const cardTitled = (title: string): HTMLElement => {
const card = screen.getByText(title).closest('[data-slot="card"]');
expect(card).not.toBeNull();
return card as HTMLElement;
};

const findChartCards = async () => {
await screen.findByText("Cache Hits vs API Requests");
await screen.findByText(REQUESTS_CHART_TITLE);
await waitFor(() => {
expect(document.querySelectorAll("path.recharts-rectangle").length).toBeGreaterThan(0);
});
const cards = Array.from(document.querySelectorAll('[data-slot="card"]'));
expect(cards).toHaveLength(2);
return { requestsCard: cards[0] as HTMLElement, tokensCard: cards[1] as HTMLElement };
return { requestsCard: cardTitled(REQUESTS_CHART_TITLE), tokensCard: cardTitled(TOKENS_CHART_TITLE) };
};

const barFills = (card: HTMLElement) =>
Expand Down
Loading
Loading