@@ -37,6 +37,7 @@ const gridStub = {
37
37
getSortColumns : jest . fn ( ) ,
38
38
invalidate : jest . fn ( ) ,
39
39
onColumnsResized : new Slick . Event ( ) ,
40
+ onColumnsReordered : new Slick . Event ( ) ,
40
41
onSort : new Slick . Event ( ) ,
41
42
render : jest . fn ( ) ,
42
43
setColumns : jest . fn ( ) ,
@@ -184,6 +185,18 @@ describe('GroupingAndColspanService', () => {
184
185
expect ( setTimeout ) . toHaveBeenLastCalledWith ( expect . any ( Function ) , 50 ) ;
185
186
} ) ;
186
187
188
+ it ( 'should call the "renderPreHeaderRowGroupingTitles" after triggering a grid "onColumnsReordered"' , ( ) => {
189
+ const spy = jest . spyOn ( service , 'renderPreHeaderRowGroupingTitles' ) ;
190
+
191
+ service . init ( gridStub , dataViewStub ) ;
192
+ gridStub . onColumnsReordered . notify ( { } , new Slick . EventData ( ) , gridStub ) ;
193
+ jest . runAllTimers ( ) ; // fast-forward timer
194
+
195
+ expect ( spy ) . toHaveBeenCalledTimes ( 2 ) ;
196
+ expect ( setTimeout ) . toHaveBeenCalledTimes ( 1 ) ;
197
+ expect ( setTimeout ) . toHaveBeenLastCalledWith ( expect . any ( Function ) , 50 ) ;
198
+ } ) ;
199
+
187
200
it ( 'should call the "renderPreHeaderRowGroupingTitles" after triggering a dataView "onColumnsResized"' , ( ) => {
188
201
const spy = jest . spyOn ( service , 'renderPreHeaderRowGroupingTitles' ) ;
189
202
0 commit comments