( enableVirtualization: boolean, columnCount: number, rowCount: number, frozenColumnCount = 0, summaryRowCount = 0 )
| 4 | const rowHeight = 35; |
| 5 | |
| 6 | function setupGrid( |
| 7 | enableVirtualization: boolean, |
| 8 | columnCount: number, |
| 9 | rowCount: number, |
| 10 | frozenColumnCount = 0, |
| 11 | summaryRowCount = 0 |
| 12 | ) { |
| 13 | const columns: Column<unknown>[] = []; |
| 14 | const rows = new Array(rowCount); |
| 15 | const topSummaryRows = new Array(summaryRowCount).fill(null); |
| 16 | const bottomSummaryRows = new Array(summaryRowCount).fill(null); |
| 17 | |
| 18 | for (let i = 0; i < columnCount; i++) { |
| 19 | const key = String(i); |
| 20 | columns.push({ |
| 21 | key, |
| 22 | name: key, |
| 23 | width: 100 + ((i * 10) % 50), |
| 24 | frozen: i < frozenColumnCount |
| 25 | }); |
| 26 | } |
| 27 | |
| 28 | return setup({ |
| 29 | columns, |
| 30 | rows, |
| 31 | topSummaryRows, |
| 32 | bottomSummaryRows, |
| 33 | rowHeight, |
| 34 | enableVirtualization |
| 35 | }); |
| 36 | } |
| 37 | |
| 38 | function assertElements( |
| 39 | elements: Element[], |
no test coverage detected