@@ -1625,8 +1625,12 @@ describe('IgxGrid Component Tests #grid', () => {
16251625 const headers = fix . debugElement . queryAll ( By . css ( COLUMN_HEADER_CLASS ) ) ;
16261626 expect ( headers . length ) . toBe ( 4 ) ;
16271627 const gridBody = fix . debugElement . query ( By . css ( TBODY_CLASS ) ) ;
1628+ const expectedHeight = fix . debugElement . query ( By . css ( 'igx-grid' ) ) . nativeElement . getBoundingClientRect ( ) . height -
1629+ grid . nativeElement . querySelector ( '.igx-grid__thead' ) . getBoundingClientRect ( ) . height -
1630+ grid . nativeElement . querySelector ( '.igx-grid__tfoot' ) . getBoundingClientRect ( ) . height -
1631+ grid . nativeElement . querySelector ( '.igx-grid__scroll' ) . getBoundingClientRect ( ) . height ;
16281632 expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . width , 10 ) + grid . scrollWidth ) . toBe ( 500 ) ;
1629- expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBe ( 230 ) ;
1633+ expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBe ( expectedHeight ) ;
16301634 } ) ;
16311635
16321636 it ( 'IgxTabs: should initialize a grid with correct height when paging and summaries are enabled' , async ( ) => {
@@ -1644,7 +1648,11 @@ describe('IgxGrid Component Tests #grid', () => {
16441648 const summaries = fix . debugElement . queryAll ( By . css ( 'igx-grid-summary-cell' ) ) ;
16451649 expect ( headers . length ) . toBe ( 4 ) ;
16461650 expect ( summaries . length ) . toBe ( 4 ) ;
1647- expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBe ( 139 ) ;
1651+ const expectedHeight = fix . debugElement . query ( By . css ( 'igx-grid' ) ) . nativeElement . getBoundingClientRect ( ) . height -
1652+ grid . nativeElement . querySelector ( '.igx-grid__thead' ) . getBoundingClientRect ( ) . height -
1653+ grid . nativeElement . querySelector ( '.igx-grid__tfoot' ) . getBoundingClientRect ( ) . height -
1654+ grid . nativeElement . querySelector ( '.igx-grid__scroll' ) . getBoundingClientRect ( ) . height ;
1655+ expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBe ( expectedHeight ) ;
16481656 expect ( parseInt ( window . getComputedStyle ( paging . nativeElement ) . height , 10 ) ) . toBe ( 36 ) ;
16491657 } ) ;
16501658
@@ -1677,8 +1685,12 @@ describe('IgxGrid Component Tests #grid', () => {
16771685 await wait ( 100 ) ;
16781686 grid . cdr . detectChanges ( ) ;
16791687 const gridBody = fix . debugElement . query ( By . css ( TBODY_CLASS ) ) ;
1680- expect ( grid . calcHeight ) . toBe ( 230 ) ;
1681- expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBe ( 230 ) ;
1688+ const expectedHeight = fix . debugElement . query ( By . css ( 'igx-grid' ) ) . nativeElement . getBoundingClientRect ( ) . height -
1689+ grid . nativeElement . querySelector ( '.igx-grid__thead' ) . getBoundingClientRect ( ) . height -
1690+ grid . nativeElement . querySelector ( '.igx-grid__tfoot' ) . getBoundingClientRect ( ) . height -
1691+ grid . nativeElement . querySelector ( '.igx-grid__scroll' ) . getBoundingClientRect ( ) . height ;
1692+ expect ( grid . calcHeight ) . toBe ( expectedHeight ) ;
1693+ expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBe ( expectedHeight ) ;
16821694 expect ( parseInt ( window . getComputedStyle ( grid . nativeElement ) . height , 10 ) ) . toBe ( 300 ) ;
16831695 } ) ;
16841696 } ) ;
0 commit comments