( props: DataGridProps<R, SR, K>, renderBeforeAfterButtons = false )
| 5 | import type { DataGridProps } from '../../src'; |
| 6 | |
| 7 | export function setup<R, SR, K extends React.Key = React.Key>( |
| 8 | props: DataGridProps<R, SR, K>, |
| 9 | renderBeforeAfterButtons = false |
| 10 | ) { |
| 11 | const grid = ( |
| 12 | <DataGrid |
| 13 | {...props} |
| 14 | className={css` |
| 15 | block-size: 1080px; |
| 16 | scrollbar-width: none; |
| 17 | `} |
| 18 | /> |
| 19 | ); |
| 20 | |
| 21 | if (renderBeforeAfterButtons) { |
| 22 | return page.render( |
| 23 | <> |
| 24 | <button type="button">Before</button> |
| 25 | {grid} |
| 26 | <br /> |
| 27 | <button type="button">After</button> |
| 28 | </> |
| 29 | ); |
| 30 | } |
| 31 | return page.render(grid); |
| 32 | } |
| 33 | |
| 34 | export function getGrid() { |
| 35 | return page.getByRole('grid'); |
no outgoing calls