@@ -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' ;
@@ -14,6 +14,7 @@ import { IgxActionStripModule } from '../../action-strip/action-strip.module';
1414import { UIInteractions , wait } from '../../test-utils/ui-interactions.spec' ;
1515
1616describe ( 'IgxGrid - Row Adding #grid' , ( ) => {
17+ const SUMMARY_ROW = 'igx-grid-summary-row' ;
1718 let fixture ;
1819 let grid : IgxGridComponent ;
1920 let gridContent : DebugElement ;
@@ -196,5 +197,21 @@ describe('IgxGrid - Row Adding #grid', () => {
196197 expect ( rowOffsets . top >= gridOffsets . top && rowOffsets . bottom <= gridOffsets . bottom ) . toBeTruthy ( ) ;
197198 } ) ;
198199
200+ it ( 'should update summaries after row is added via the UI.' , ( ) => {
201+ grid . getColumnByName ( 'ID' ) . hasSummary = true ;
202+ fixture . detectChanges ( ) ;
203+ let summaryRow = fixture . debugElement . query ( By . css ( SUMMARY_ROW ) ) ;
204+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 0 , [ 'Count' ] , [ '27' ] ) ;
205+
206+ grid . rowList . first . beginAddRow ( ) ;
207+ fixture . detectChanges ( ) ;
208+
209+ grid . endEdit ( true ) ;
210+ fixture . detectChanges ( ) ;
211+
212+ summaryRow = fixture . debugElement . query ( By . css ( SUMMARY_ROW ) ) ;
213+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 0 , [ 'Count' ] , [ '28' ] ) ;
214+ } ) ;
215+
199216 } ) ;
200217} ) ;
0 commit comments