@@ -23,6 +23,7 @@ describe('IgxGrid - multi-column headers', () => {
23
23
OneGroupThreeColsGridComponent ,
24
24
BlueWhaleGridComponent ,
25
25
ColumnGroupTestComponent ,
26
+ ColumnGroupChildLevelTestComponent ,
26
27
ColumnGroupFourLevelTestComponent ,
27
28
ThreeGroupsThreeColumnsGridComponent ,
28
29
ColumnGroupTwoGroupsTestComponent
@@ -46,7 +47,7 @@ describe('IgxGrid - multi-column headers', () => {
46
47
} ) ;
47
48
48
49
it ( 'column hiding - parent level' , ( ) => {
49
- const fixture = TestBed . createComponent ( ColumnGroupTestComponent ) ;
50
+ const fixture = TestBed . createComponent ( ColumnGroupFourLevelTestComponent ) ;
50
51
fixture . detectChanges ( ) ;
51
52
const grid = fixture . componentInstance . grid ;
52
53
const addressGroup = grid . columnList . filter ( c => c . header === 'Address Information' ) [ 0 ] ;
@@ -58,15 +59,15 @@ describe('IgxGrid - multi-column headers', () => {
58
59
} ) ;
59
60
60
61
it ( 'column hiding - child level' , ( ) => {
61
- const fixture = TestBed . createComponent ( ColumnGroupTestComponent ) ;
62
+ const fixture = TestBed . createComponent ( ColumnGroupChildLevelTestComponent ) ;
62
63
fixture . detectChanges ( ) ;
63
64
const grid = fixture . componentInstance . grid ;
64
- const addressGroup = grid . columnList . filter ( c => c . header === 'Address Information ' ) [ 0 ] ;
65
+ const addressGroup = grid . columnList . filter ( c => c . header === 'Address' ) [ 0 ] ;
65
66
66
67
addressGroup . children . first . hidden = true ;
67
68
fixture . detectChanges ( ) ;
68
69
69
- expect ( document . querySelectorAll ( 'igx-grid-header' ) . length ) . toEqual ( 11 ) ;
70
+ expect ( document . querySelectorAll ( 'igx-grid-header' ) . length ) . toEqual ( 5 ) ;
70
71
expect ( addressGroup . children . first . hidden ) . toBe ( true ) ;
71
72
expect ( addressGroup . children . first . children . toArray ( ) . every ( c => c . hidden === true ) ) . toEqual ( true ) ;
72
73
} ) ;
@@ -865,6 +866,34 @@ export class ColumnGroupFourLevelTestComponent {
865
866
data = DATASOURCE ;
866
867
}
867
868
869
+ @Component ( {
870
+ template : `
871
+ <igx-grid #grid [data]="data" height="600px" width="800px">
872
+ <igx-column field="ID"></igx-column>
873
+ <igx-column-group header="Address">
874
+ <igx-column-group header="Location">
875
+ <igx-column field="Country"></igx-column>
876
+ <igx-column field="Region"></igx-column>
877
+ <igx-column-group header="Location City">
878
+ <igx-column field="City"></igx-column>
879
+ <igx-column field="Address"></igx-column>
880
+ </igx-column-group>
881
+ </igx-column-group>
882
+ <igx-column-group header="Contact Information">
883
+ <igx-column field="Phone"></igx-column>
884
+ <igx-column field="Fax"></igx-column>
885
+ </igx-column-group>
886
+ </igx-column-group>
887
+ </igx-grid>
888
+ `
889
+ } )
890
+ export class ColumnGroupChildLevelTestComponent {
891
+ @ViewChild ( IgxGridComponent , { read : IgxGridComponent } )
892
+ grid : IgxGridComponent ;
893
+
894
+ data = DATASOURCE ;
895
+ }
896
+
868
897
869
898
@Component ( {
870
899
template : `
0 commit comments