File tree Expand file tree Collapse file tree 4 files changed +78
-22
lines changed
packages/pluggableWidgets/datagrid-web/src/components/__tests__ Expand file tree Collapse file tree 4 files changed +78
-22
lines changed Original file line number Diff line number Diff line change 4949 "@codemirror/state" : " ^6.5.2" ,
5050 "@codemirror/view" : " ^6.38.1" ,
5151 "@mendix/pluggable-widgets-tools" : " 10.21.2" ,
52+ "@testing-library/react" : " >=15.0.6" ,
5253 "@types/big.js" : " ^6.2.2" ,
5354 "@types/node" : " ~22.14.0" ,
5455 "@types/react" : " >=18.2.36" ,
Original file line number Diff line number Diff line change 1+ import { render } from "@testing-library/react" ;
2+ import { ContainerProvider } from "brandi-react" ;
3+ import { createDatagridContainer } from "../../model/containers/createDatagridContainer" ;
4+ import { mockContainerProps } from "../../utils/test-utils" ;
5+ import { Grid } from "../Grid" ;
6+
7+ describe ( "Grid" , ( ) => {
8+ it ( "renders without crashing" , ( ) => {
9+ const props = mockContainerProps ( ) ;
10+ const [ container ] = createDatagridContainer ( props ) ;
11+ const { asFragment } = render (
12+ < ContainerProvider container = { container } >
13+ < Grid > Test</ Grid >
14+ </ ContainerProvider >
15+ ) ;
16+
17+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
18+ } ) ;
19+
20+ it ( "renders without selector column" , ( ) => {
21+ const [ container ] = createDatagridContainer ( {
22+ ...mockContainerProps ( ) ,
23+ columnsHidable : false
24+ } ) ;
25+ const { asFragment } = render (
26+ < ContainerProvider container = { container } >
27+ < Grid > Test</ Grid >
28+ </ ContainerProvider >
29+ ) ;
30+
31+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
32+ } ) ;
33+ } ) ;
Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+ exports [` Grid renders without crashing 1` ] = `
4+ <DocumentFragment >
5+ <div
6+ class = " widget-datagrid-grid table"
7+ role = " grid"
8+ style = " grid-template-columns: 1fr 1fr 54px;"
9+ >
10+ Test
11+ </div >
12+ </DocumentFragment >
13+ ` ;
14+
15+ exports [` Grid renders without selector column 1` ] = `
16+ <DocumentFragment >
17+ <div
18+ class = " widget-datagrid-grid table"
19+ role = " grid"
20+ style = " grid-template-columns: 1fr 1fr;"
21+ >
22+ Test
23+ </div >
24+ </DocumentFragment >
25+ ` ;
You can’t perform that action at this time.
0 commit comments