Skip to content

Commit 662ee77

Browse files
committed
Update VGrid.ssr.spec.tsx
1 parent 82e1ad9 commit 662ee77

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

src/react/VGrid.ssr.spec.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,37 @@ import { JSDOM } from "jsdom";
99
const LIST_ID = "list-id";
1010

1111
describe("SSR", () => {
12+
it("should render nothing", () => {
13+
const ROW_COUNT = 0;
14+
const COL_COUNT = 0;
15+
const ITEM_SIZE = 40;
16+
const BUFFER_SIZE = ITEM_SIZE * 4;
17+
const html = renderToString(
18+
<VGrid
19+
id={LIST_ID}
20+
initialRowCount={ROW_COUNT}
21+
initialColCount={COL_COUNT}
22+
cellHeight={ITEM_SIZE}
23+
cellWidth={ITEM_SIZE}
24+
bufferSize={BUFFER_SIZE}
25+
row={1000}
26+
col={5000}
27+
>
28+
{({ rowIndex, colIndex }) => (
29+
<div>
30+
{rowIndex}-{colIndex}
31+
</div>
32+
)}
33+
</VGrid>
34+
);
35+
expect(html).toMatchSnapshot();
36+
37+
expect(
38+
new JSDOM(html).window.document.getElementById(LIST_ID)!.children[0]!
39+
.childElementCount
40+
).toEqual(ROW_COUNT * COL_COUNT);
41+
});
42+
1243
it("should render items with renderToString and vertical", () => {
1344
const ROW_COUNT = 10;
1445
const COL_COUNT = 20;

0 commit comments

Comments
 (0)