diff --git a/src/components/ui/data-table.test.tsx b/src/components/ui/data-table.test.tsx index b34fc08..652d733 100644 --- a/src/components/ui/data-table.test.tsx +++ b/src/components/ui/data-table.test.tsx @@ -101,3 +101,21 @@ test("shows the pagination footer on a single page", () => { expect((screen.getByRole("button", { name: "Previous" }) as HTMLButtonElement).disabled).toBe(true); expect((screen.getByRole("button", { name: "Next" }) as HTMLButtonElement).disabled).toBe(true); }); + +test("a display column renders its own cell instead of the empty dash", () => { + // A column with no accessorFn has no value to be empty, so the empty-cell + // fallback must not swallow its render function. + render(() => ( + + `#${c.row.original.name}` }, + ] as ColumnDef[]} + data={[{ name: "ada" }]} + /> + + )); + + expect(screen.getByText("#ada")).toBeTruthy(); +}); diff --git a/src/components/ui/data-table.tsx b/src/components/ui/data-table.tsx index e3ea3ff..e56559f 100644 --- a/src/components/ui/data-table.tsx +++ b/src/components/ui/data-table.tsx @@ -355,7 +355,13 @@ export function DataTable(props: DataTableProps