Skip to content

Commit 4e940c2

Browse files
test(datagrid-web): pin date reference and assert display value in cell-readers spec
1 parent 22ec7f7 commit 4e940c2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/pluggableWidgets/datagrid-web/src/features/data-export/__tests__/cell-readers.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,15 @@ describe("cell-readers", () => {
8181
});
8282

8383
it("exports date attribute without format as string cell (displayValue)", () => {
84+
const testDate = new Date("2024-06-15T10:30:00Z");
8485
const col = column("Created", c => {
8586
c.showContentAs = "attribute";
86-
c.attribute = listAttribute(() => new Date("2024-06-15T10:30:00Z"));
87+
c.attribute = listAttribute(() => testDate);
8788
c.exportType = "default";
8889
});
8990
const cell = readSingleCell(col);
9091
expect(cell.t).toBe("s");
92+
expect(cell.v).toBe(`Formatted ${testDate}`);
9193
});
9294

9395
it("returns empty cell when attribute is not available", () => {

0 commit comments

Comments
 (0)