Commit dff7515 1 parent 9a0f5c5 commit dff7515 Copy full SHA for dff7515
File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,27 @@ describe("Table", function() {
86
86
testButton . simulate ( "click" ) ;
87
87
expect ( component . state ( ) . selectedRows . length ) . toBe ( 0 ) ;
88
88
} ) ;
89
+
90
+ test ( "Table with selection header bar should send selected data for rows added after mount" , ( ) => {
91
+ const selectionHeaderRenderer = jest . fn ( ) ;
92
+ const component = mount (
93
+ < Table
94
+ data = { dataFixture }
95
+ selectableRows
96
+ selectionHeader = { selectionHeaderRenderer }
97
+ >
98
+ < Column clickable title = "Name" text = { row => row . name } />
99
+ </ Table >
100
+ ) ;
101
+
102
+ const newRow = { name : "New Row" } ;
103
+ const newData = dataFixture . concat ( newRow ) ;
104
+ component . setProps ( { data : newData } ) ;
105
+
106
+ const lastRowCheckbox = component . find ( "td input" ) . last ( ) ;
107
+ lastRowCheckbox . simulate ( "change" , { target : { checked : true } } ) ;
108
+ expect ( selectionHeaderRenderer . mock . calls [ 0 ] [ 0 ] ) . toEqual ( [ newRow ] ) ;
109
+ } ) ;
89
110
} ) ;
90
111
91
112
describe ( "Expandable Row Groups" , ( ) => {
You can’t perform that action at this time.
0 commit comments