File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,37 @@ import { JSDOM } from "jsdom";
99const LIST_ID = "list-id" ;
1010
1111describe ( "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 ;
You can’t perform that action at this time.
0 commit comments