@@ -2284,6 +2284,57 @@ describe('IgxGrid - Summaries #grid', () => {
2284
2284
GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 5 , [ 'Count' ] , [ '3' ] ) ;
2285
2285
} ) ;
2286
2286
2287
+ it ( 'CRUD: Adding grouped item via UI should update group summary accordingly' , ( ) => {
2288
+ grid . rowEditable = true ;
2289
+ fix . detectChanges ( ) ;
2290
+ const newRow = {
2291
+ ID : 777 ,
2292
+ ParentID : 17 ,
2293
+ Name : 'New Employee' ,
2294
+ HireDate : new Date ( 2019 , 3 , 3 ) ,
2295
+ Age : 19 ,
2296
+ OnPTO : true
2297
+ } ;
2298
+ const rows = grid . rowList . toArray ( ) ;
2299
+ rows [ 1 ] . beginAddRow ( ) ;
2300
+
2301
+ const animationElem = fix . nativeElement . querySelector ( '.igx-grid__tr--inner' ) ;
2302
+ const endEvent = new AnimationEvent ( 'animationend' ) ;
2303
+ animationElem . dispatchEvent ( endEvent ) ;
2304
+
2305
+ fix . detectChanges ( ) ;
2306
+
2307
+ let addRow = grid . gridAPI . get_row_by_index ( 2 ) ;
2308
+ expect ( addRow . addRowUI ) . toBeTrue ( ) ;
2309
+
2310
+ let cell = grid . getCellByColumn ( 2 , 'ParentID' ) ;
2311
+ cell . update ( newRow . ParentID ) ;
2312
+ cell = grid . getCellByColumn ( 2 , 'Name' ) ;
2313
+ cell . update ( newRow . Name ) ;
2314
+ cell = grid . getCellByColumn ( 2 , 'HireDate' ) ;
2315
+ cell . update ( newRow . HireDate ) ;
2316
+ cell = grid . getCellByColumn ( 2 , 'Age' ) ;
2317
+ cell . update ( newRow . Age ) ;
2318
+ cell = grid . getCellByColumn ( 2 , 'OnPTO' ) ;
2319
+ cell . update ( newRow . OnPTO ) ;
2320
+
2321
+ fix . detectChanges ( ) ;
2322
+ grid . endEdit ( true ) ;
2323
+
2324
+ fix . detectChanges ( ) ;
2325
+
2326
+ addRow = grid . gridAPI . get_row_by_index ( 2 ) ;
2327
+ expect ( addRow . addRowUI ) . toBeFalse ( ) ;
2328
+
2329
+ let summaryRow = GridSummaryFunctions . getSummaryRowByDataRowIndex ( fix , 4 ) ;
2330
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 0 , [ ] , [ ] ) ;
2331
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 1 , [ 'Count' , 'Min' , 'Max' , 'Sum' , 'Avg' ] , [ '3' , '17' , '17' , '51' , '17' ] ) ;
2332
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 2 , [ 'Count' ] , [ '3' ] ) ;
2333
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 3 ,
2334
+ [ 'Count' , 'Earliest' , 'Latest' ] , [ '3' , 'Dec 18, 2007' , 'Apr 3, 2019' ] ) ;
2335
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 5 , [ 'Count' ] , [ '3' ] ) ;
2336
+ } ) ;
2337
+
2287
2338
it ( 'CRUD: Add not grouped item' , ( ) => {
2288
2339
const newRow = {
2289
2340
ID : 777 ,
0 commit comments