@@ -3,7 +3,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
33import { async , TestBed , fakeAsync } from '@angular/core/testing' ;
44import { configureTestSuite } from '../../test-utils/configure-suite' ;
55import { DebugElement } from '@angular/core' ;
6- import { GridFunctions } from '../../test-utils/grid-functions.spec' ;
6+ import { GridFunctions , GridSummaryFunctions } from '../../test-utils/grid-functions.spec' ;
77import {
88 IgxAddRowComponent
99} from '../../test-utils/grid-samples.spec' ;
@@ -15,6 +15,7 @@ import { UIInteractions, wait } from '../../test-utils/ui-interactions.spec';
1515import { IgxGridRowComponent } from './grid-row.component' ;
1616
1717describe ( 'IgxGrid - Row Adding #grid' , ( ) => {
18+ const SUMMARY_ROW = 'igx-grid-summary-row' ;
1819 let fixture ;
1920 let grid : IgxGridComponent ;
2021 let gridContent : DebugElement ;
@@ -242,5 +243,21 @@ describe('IgxGrid - Row Adding #grid', () => {
242243 expect ( rowOffsets . top >= gridOffsets . top && rowOffsets . bottom <= gridOffsets . bottom ) . toBeTruthy ( ) ;
243244 } ) ;
244245
246+ it ( 'should update summaries after row is added via the UI.' , ( ) => {
247+ grid . getColumnByName ( 'ID' ) . hasSummary = true ;
248+ fixture . detectChanges ( ) ;
249+ let summaryRow = fixture . debugElement . query ( By . css ( SUMMARY_ROW ) ) ;
250+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 0 , [ 'Count' ] , [ '27' ] ) ;
251+
252+ grid . rowList . first . beginAddRow ( ) ;
253+ fixture . detectChanges ( ) ;
254+
255+ grid . endEdit ( true ) ;
256+ fixture . detectChanges ( ) ;
257+
258+ summaryRow = fixture . debugElement . query ( By . css ( SUMMARY_ROW ) ) ;
259+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 0 , [ 'Count' ] , [ '28' ] ) ;
260+ } ) ;
261+
245262 } ) ;
246263} ) ;
0 commit comments