@@ -13,6 +13,7 @@ import { DefaultSortingStrategy } from '../../data-operations/sorting-strategy';
13
13
import { IgxStringFilteringOperand } from '../../data-operations/filtering-condition' ;
14
14
import { configureTestSuite } from '../../test-utils/configure-suite' ;
15
15
import { IgxGridHeaderComponent } from '../headers/grid-header.component' ;
16
+ import { GridSummaryFunctions } from '../../test-utils/grid-functions.spec' ;
16
17
17
18
const GRID_COL_THEAD_TITLE_CLASS = 'igx-grid__th-title' ;
18
19
const GRID_COL_GROUP_THEAD_TITLE_CLASS = 'igx-grid__thead-title' ;
@@ -179,6 +180,8 @@ describe('IgxGrid - multi-column headers #grid', () => {
179
180
expect ( getColGroup ( grid , 'General Information' ) . hidden ) . toEqual ( false ) ;
180
181
} ) ) ;
181
182
183
+
184
+
182
185
it ( 'Width should be correct. Column group with column. No width.' , fakeAsync ( /** height/width setter rAF */ ( ) => {
183
186
const fixture = TestBed . createComponent ( OneGroupOneColGridComponent ) ;
184
187
fixture . detectChanges ( ) ;
@@ -1215,6 +1218,28 @@ describe('IgxGrid - multi-column headers #grid', () => {
1215
1218
expect ( grid . getCellByColumn ( 4 , 'Country' ) . value ) . toEqual ( 'Sweden' ) ;
1216
1219
} ) ) ;
1217
1220
1221
+ it ( 'summaries - verify summaries when there are grouped columns' , fakeAsync ( ( ) => {
1222
+ const fixture = TestBed . createComponent ( ColumnGroupFourLevelTestComponent ) ;
1223
+ fixture . detectChanges ( ) ;
1224
+ const grid = fixture . componentInstance . grid ;
1225
+ const allColumns = grid . columnList ;
1226
+ allColumns . forEach ( ( col ) => {
1227
+ if ( ! col . columnGroup ) {
1228
+ col . hasSummary = true ;
1229
+ }
1230
+ } ) ;
1231
+ fixture . detectChanges ( ) ;
1232
+
1233
+ const summaryRow = GridSummaryFunctions . getRootSummaryRow ( fixture ) ;
1234
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 0 , [ 'Count' ] , [ '27' ] ) ;
1235
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 1 , [ 'Count' ] , [ '27' ] ) ;
1236
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 2 , [ 'Count' ] , [ '27' ] ) ;
1237
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 3 , [ 'Count' ] , [ '27' ] ) ;
1238
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 4 , [ 'Count' ] , [ '27' ] ) ;
1239
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 5 , [ 'Count' ] , [ '27' ] ) ;
1240
+ GridSummaryFunctions . verifyColumnSummaries ( summaryRow , 6 , [ 'Count' ] , [ '27' ] ) ;
1241
+ } ) ) ;
1242
+
1218
1243
it ( 'filtering - filter a grouped column' , fakeAsync ( ( ) => {
1219
1244
const fixture = TestBed . createComponent ( ColumnGroupFourLevelTestComponent ) ;
1220
1245
fixture . detectChanges ( ) ;
@@ -1275,6 +1300,7 @@ describe('IgxGrid - multi-column headers #grid', () => {
1275
1300
} ) ) ;
1276
1301
1277
1302
1303
+
1278
1304
it ( 'grouping - verify grouping when there are grouped columns' , fakeAsync ( /** height/width setter rAF */ ( ) => {
1279
1305
const fixture = TestBed . createComponent ( ColumnGroupGroupingTestComponent ) ;
1280
1306
fixture . detectChanges ( ) ;
0 commit comments