@@ -58,19 +58,19 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
5858 expect ( hierarchicalGrid . columnList . filter ( col => col . columnGroup ) . length ) . toEqual ( expectedColumnGroups ) ;
5959 expect ( hierarchicalGrid . getColumnByName ( 'ProductName' ) . level ) . toEqual ( expectedLevel ) ;
6060
61- expect ( document . querySelectorAll ( 'igx-grid-header' ) . length ) . toEqual ( 3 ) ;
61+ expect ( GridFunctions . getColumnHeaders ( fixture ) . length ) . toEqual ( 3 ) ;
6262
6363 const firstRow = hierarchicalGrid . dataRowList . first ;
6464 // the first row's cell should contain an expand indicator
65- expect ( firstRow . nativeElement . children [ 0 ] . classList . contains ( 'igx-grid__hierarchical-expander' ) ) . toBeTruthy ( ) ;
65+ expect ( HierarchicalGridFunctions . hasExpander ( firstRow ) ) . toBeTruthy ( ) ;
6666 hierarchicalGrid . expandRow ( firstRow . rowID ) ;
6767
6868 const childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
6969
7070 expect ( childGrid . columnList . filter ( col => col . columnGroup ) . length ) . toEqual ( expectedColumnGroups ) ;
7171 expect ( childGrid . getColumnByName ( 'ProductName' ) . level ) . toEqual ( expectedLevel ) ;
7272
73- expect ( document . querySelectorAll ( 'igx-grid-header' ) . length ) . toEqual ( 6 ) ;
73+ expect ( GridFunctions . getColumnHeaders ( fixture ) . length ) . toEqual ( 6 ) ;
7474 } ) ) ;
7575
7676 it ( 'should apply height correctly with and without filtering' , fakeAsync ( ( ) => {
@@ -235,14 +235,14 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
235235 childGrid . columnList . first . sortable = true ;
236236 fixture . detectChanges ( ) ;
237237
238- const childHeaders = fixture . debugElement . query ( By . css ( 'igx-child-grid-row' ) ) . queryAll ( By . css ( 'igx-grid-header' ) ) ;
239- GridFunctions . clickHeaderSortIcon ( childHeaders [ 0 ] ) ;
238+ const childHeader = GridFunctions . getColumnHeader ( 'ID' , fixture , childGrid ) ;
239+ GridFunctions . clickHeaderSortIcon ( childHeader ) ;
240240 fixture . detectChanges ( ) ;
241- GridFunctions . clickHeaderSortIcon ( childHeaders [ 0 ] ) ;
241+ GridFunctions . clickHeaderSortIcon ( childHeader ) ;
242242 fixture . detectChanges ( ) ;
243243
244244 expect ( childGrid . dataRowList . first . cells . first . value ) . toBe ( '09' ) ;
245- const icon = GridFunctions . getHeaderSortIcon ( childHeaders [ 0 ] ) ;
245+ const icon = GridFunctions . getHeaderSortIcon ( childHeader ) ;
246246 expect ( icon ) . not . toBeNull ( ) ;
247247 expect ( icon . nativeElement . textContent . toLowerCase ( ) . trim ( ) ) . toBe ( 'arrow_downward' ) ;
248248 } ) ) ;
@@ -270,8 +270,7 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
270270 it ( 'should not lose child grid states after filtering in parent grid.' , fakeAsync ( ( ) => {
271271 // expand first row
272272 hierarchicalGrid . expandRow ( hierarchicalGrid . dataRowList . first . rowID ) ;
273- const childGrids = fixture . debugElement . queryAll ( By . css ( 'igx-child-grid-row' ) ) ;
274- let childGrid = childGrids [ 0 ] . query ( By . css ( 'igx-hierarchical-grid' ) ) . componentInstance ;
273+ let childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
275274 let firstChildCell = childGrid . dataRowList . first . cells . first ;
276275 UIInteractions . simulateClickAndSelectCellEvent ( firstChildCell ) ;
277276 expect ( firstChildCell . selected ) . toBe ( true ) ;
@@ -282,7 +281,7 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
282281 expect ( ( hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ) . expanded ) . toBe ( true ) ;
283282 expect ( hierarchicalGrid . getRowByIndex ( 1 ) instanceof IgxChildGridRowComponent ) . toBeTruthy ( ) ;
284283
285- childGrid = childGrids [ 0 ] . query ( By . css ( 'igx-hierarchical-grid' ) ) . componentInstance ;
284+ childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
286285 firstChildCell = childGrid . dataRowList . first . cells . first ;
287286 expect ( firstChildCell . selected ) . toBe ( true ) ;
288287 } ) ) ;
@@ -305,17 +304,17 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
305304 it ( 'should apply classes to the header when filter row is visible' , fakeAsync ( ( ) => {
306305 hierarchicalGrid . rowSelection = GridSelectionMode . multiple ;
307306 fixture . detectChanges ( ) ;
308- const headerExpander : HTMLElement = fixture . nativeElement . querySelector ( '.igx-grid__hierarchical-expander' ) ;
309- const headerCheckbox : HTMLElement = fixture . nativeElement . querySelector ( '.igx-grid__cbx-selection' ) ;
307+ const headerExpander : HTMLElement = HierarchicalGridFunctions . getExpander ( fixture ) ;
308+ const headerCheckbox : HTMLElement = GridSelectionFunctions . getRowCheckboxDiv ( fixture . nativeElement ) ;
310309
311- expect ( headerExpander . classList . contains ( 'igx-grid__hierarchical-expander --push') ) . toBeFalsy ( ) ;
312- expect ( headerCheckbox . classList . contains ( 'igx-grid__cbx-selection --push') ) . toBeFalsy ( ) ;
310+ expect ( HierarchicalGridFunctions . isExpander ( headerExpander , ' --push') ) . toBeFalsy ( ) ;
311+ expect ( GridSelectionFunctions . isCheckbox ( headerCheckbox , ' --push') ) . toBeFalsy ( ) ;
313312
314313 // open filter row
315314 GridFunctions . clickFilterCellChipUI ( fixture , 'ID' ) ;
316315
317- expect ( headerExpander . classList . contains ( 'igx-grid__hierarchical-expander --push') ) . toBeTruthy ( ) ;
318- expect ( headerCheckbox . classList . contains ( 'igx-grid__cbx-selection --push') ) . toBeTruthy ( ) ;
316+ expect ( HierarchicalGridFunctions . isExpander ( headerExpander , ' --push') ) . toBeTruthy ( ) ;
317+ expect ( GridSelectionFunctions . isCheckbox ( headerCheckbox , ' --push') ) . toBeTruthy ( ) ;
319318 } ) ) ;
320319 } ) ;
321320
@@ -701,7 +700,7 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
701700 let childHeader = GridFunctions . getColumnGroupHeaders ( fixture ) [ 4 ] ;
702701 const firstHeaderIcon = childHeader . query ( By . css ( '.igx-icon' ) ) ;
703702
704- expect ( childHeader . nativeElement . classList ) . not . toContain ( 'igx-grid__th--pinned' ) ;
703+ expect ( GridFunctions . isHeaderPinned ( childHeader ) ) . toBeFalsy ( ) ;
705704 expect ( childGrid . columnList . first . pinned ) . toBeFalsy ( ) ;
706705 expect ( firstHeaderIcon ) . toBeDefined ( ) ;
707706
@@ -711,7 +710,7 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
711710
712711 childHeader = GridFunctions . getColumnGroupHeaders ( fixture ) [ 4 ] ;
713712 expect ( childGrid . columnList . first . pinned ) . toBeTruthy ( ) ;
714- expect ( childHeader . nativeElement . classList ) . toContain ( 'igx-grid__th--pinned' ) ;
713+ expect ( GridFunctions . isHeaderPinned ( childHeader ) ) . toBeTruthy ( ) ;
715714 } ) ) ;
716715
717716 it ( 'should be applied correctly for child grid with multi-column header.' , ( ( ) => {
@@ -728,13 +727,13 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
728727 expect ( childGrid . getRowByIndex ( 0 ) . cells . length ) . toBe ( 3 ) ;
729728 let cell = childGrid . getCellByColumn ( 0 , 'ChildLevels' ) ;
730729 expect ( cell . visibleColumnIndex ) . toEqual ( 0 ) ;
731- expect ( cell . nativeElement . classList ) . toContain ( 'igx-grid__td--pinned' ) ;
730+ expect ( GridFunctions . isCellPinned ( cell ) ) . toBeTruthy ( ) ;
732731 cell = childGrid . getCellByColumn ( 0 , 'ProductName' ) ;
733732 expect ( cell . visibleColumnIndex ) . toEqual ( 1 ) ;
734- expect ( cell . nativeElement . classList ) . toContain ( 'igx-grid__td--pinned' ) ;
733+ expect ( GridFunctions . isCellPinned ( cell ) ) . toBeTruthy ( ) ;
735734 cell = childGrid . getCellByColumn ( 0 , 'ID' ) ;
736735 expect ( cell . visibleColumnIndex ) . toEqual ( 2 ) ;
737- expect ( cell . nativeElement . classList ) . not . toContain ( 'igx-grid__td--pinned' ) ;
736+ expect ( GridFunctions . isCellPinned ( cell ) ) . toBeFalsy ( ) ;
738737 } ) ) ;
739738
740739 it ( 'should be applied correctly even on the right side' , ( ( ) => {
0 commit comments