Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(DataTable): add test for empty state rendering

Steven Enamakel4ddcd36e2cac
diff --git a/app/src/components/ui/DataTable.test.tsx b/app/src/components/ui/DataTable.test.tsx
index 63cd16e981..8cf79df988 100644
--- a/app/src/components/ui/DataTable.test.tsx
+++ b/app/src/components/ui/DataTable.test.tsx
@@ -73,6 +73,24 @@ describe('<DataTable />', () => {
expect(head.className).toContain('bg-surface');
}
+ // The header's scroll container must be the region that owns overflow — no
+ // `overflow-hidden` card wrapper in between, which is itself a scroll
+ // container and would silently re-break this.
+ const head = screen.getAllByRole('columnheader')[0];
+ let node: HTMLElement | null = head.parentElement;
+ let scroller: HTMLElement | null = null;
+ while (node) {
+ const cls = node.className ?? '';
+ if (typeof cls === 'string' && /overflow-(auto|scroll|hidden|x-auto|y-auto)/.test(cls)) {
+ scroller = node;
+ break;
+ }
+ node = node.parentElement;
+ }
+ expect(scroller).not.toBeNull();
+ expect(scroller?.className).toContain('overflow-auto');
+ expect(scroller?.className).not.toContain('overflow-hidden');
+
const table = screen.getByRole('table');
// `border-separate` is what lets the header keep its own bottom border
// while stuck; under `border-collapse` the border belongs to the grid and