test(ui): characterize DataTable behavior before shadcn reskin - #32208
Conversation
Pins the shared view_logs DataTable contract with library-agnostic queries ahead of the tremor-to-shadcn table migration: loading and empty states, TanStack column defs with custom cell renderers, onRowClick payload, both expansion render paths (colspan sub-component and sibling child rows), the getRowCanExpand gate, and client-side sorting on and off. These must pass unchanged after the reskin.
Greptile SummaryThis PR front-loads test coverage for the shared
Confidence Score: 5/5Pure test additions with no production code changes; safe to merge. Only change is new test coverage in a single test file. The tests accurately reflect the component's actual API and use library-agnostic queries. The one gap — the child-rows test never performs a collapse + assert-gone step — is a minor contract incompleteness, not a wrong assertion or a regression. No files require special attention; the child-rows expansion test would benefit from a collapse assertion to fully mirror the colspan test.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/view_logs/table.test.tsx | Adds 9 new behavioral tests covering loading/empty states, custom cell renderers, onRowClick payload, both expansion paths (colspan and child-rows), the getRowCanExpand gate, and client-side sorting. The child-rows expansion test is missing a collapse/hide assertion, leaving that path's toggle contract slightly weaker than the colspan path. |
Reviews (2): Last reviewed commit: "test(ui): assert child rows hidden befor..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@greptileai re review |
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Tests only; no runtime surface.
cd ui/litellm-dashboard && npx vitest run src/components/view_logs/table.test.tsxshows 11 passing (2 pre-existing sizing tests plus 9 new)Type
✅ Test
Changes
The shared
view_logsDataTable (TanStack under a Tremor skin, ~10 consumers) is about to be re-skinned onto shadcn Table primitives as part of the ShadCN migration's tables track. Per the migration plan, coverage gets front-loaded before the swap: the test is the contract, written before the refactorThis extends the existing sizing-only test file to pin the behaviors consumers actually rely on, using Testing-Library role/text queries that are component-library agnostic so the exact same tests must pass after the tremor-to-shadcn reskin: loading and empty state messages, plain TanStack ColumnDefs with custom cell renderers, the onRowClick payload, both expansion render paths (colspan sub-component and sibling child rows), the getRowCanExpand gate, and client-side sorting both disabled (default) and enabled
No production code changes