File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
chartlets.js/packages/lib/src/plugins/mui Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,17 @@ describe("Table", () => {
1818 rows = { mockRows }
1919 type = "Table"
2020 id = "tableId"
21+ ariaLabel = "Test Table"
2122 onChange = { ( ) => { } }
2223 paginationModel = { paginationModel }
2324 pageSizeOptions = { [ 10 , 25 , 50 ] }
2425 /> ,
2526 ) ;
2627 expect ( screen . getByRole ( "grid" ) ) . toBeInTheDocument ( ) ;
2728 expect ( screen . getByText ( "MockRow" ) ) . toBeInTheDocument ( ) ;
29+
30+ const grid = screen . getByTestId ( "data-grid-test-id" ) ;
31+ expect ( grid ) . toHaveAttribute ( "aria-label" , "Test Table" ) ;
2832 } ) ;
2933
3034 it ( "should handle row click" , ( ) => {
@@ -65,10 +69,19 @@ describe("Table", () => {
6569 loading = { true }
6670 /> ,
6771 ) ;
68- expect ( screen . getByTestId ( "data-grid-test-id" ) ) . toHaveAttribute (
69- "aria-label" ,
70- "Test Table" ,
71- ) ;
72+
73+ const gridRole = screen . getByTestId ( "data-grid-test-id" ) ;
74+
75+ // Check density
76+ expect ( gridRole ) . toHaveClass ( "MuiDataGrid-root--densityCompact" ) ;
77+
78+ // Check loading
79+ expect ( screen . getByRole ( "progressbar" ) ) . toBeInTheDocument ( ) ;
80+
81+ // Check checkboxSelection
82+ expect (
83+ screen . getByRole ( "columnheader" , { name : / s e l e c t / i } ) ,
84+ ) . toBeInTheDocument ( ) ;
7285 } ) ;
7386
7487 it ( "should not render if no columns are provided" , ( ) => {
You can’t perform that action at this time.
0 commit comments