@@ -442,48 +442,54 @@ describe('IgxGrid Component Tests #grid', () => {
442442
443443 const grid = fixture . componentInstance . grid ;
444444 const gridElement = fixture . debugElement . query ( By . css ( '.igx-grid' ) ) ;
445- const gridBody = fixture . debugElement . query ( By . css ( TBODY_CLASS ) ) ;
446- let loadingIndicator = gridBody . query ( By . css ( '.igx-grid__loading' ) ) ;
445+ const gridBodyContent = fixture . debugElement . query ( By . css ( TBODY_CLASS ) ) ;
446+ let loadingIndicator = gridBodyContent . query ( By . css ( '.igx-grid__loading' ) ) ;
447447
448448 expect ( loadingIndicator ) . not . toBeNull ( ) ;
449- expect ( gridBody . nativeElement . textContent ) . not . toEqual ( grid . emptyFilteredGridMessage ) ;
449+ expect ( gridBodyContent . nativeElement . textContent ) . not . toEqual ( grid . emptyFilteredGridMessage ) ;
450450
451451 // Check for loaded rows in grid's container
452452 fixture . componentInstance . generateData ( 30 ) ;
453453 fixture . detectChanges ( ) ;
454454 tick ( 1000 ) ;
455- expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBeGreaterThan ( 300 ) ;
455+ expect ( parseInt ( window . getComputedStyle ( gridBodyContent . nativeElement ) . height , 10 ) ) . toBeGreaterThan ( 300 ) ;
456456
457- loadingIndicator = gridBody . query ( By . css ( '.igx-grid__loading' ) ) ;
457+ loadingIndicator = gridBodyContent . query ( By . css ( '.igx-grid__loading' ) ) ;
458458 expect ( loadingIndicator ) . toBeNull ( ) ;
459459
460- // the overlay should be shown
460+ // the overlay should be shown and container should have the same dimensions as the grid's body
461461 loadingIndicator = gridElement . query ( By . css ( '.igx-grid__loading-outlet' ) ) ;
462+ const gridBody = fixture . debugElement . query ( By . css ( '.igx-grid__tbody' ) ) ;
463+ expect ( loadingIndicator . nativeElement . offsetWidth ) . toBe ( gridBody . nativeElement . offsetWidth ) ;
464+ expect ( loadingIndicator . nativeElement . offsetHeight ) . toBe ( gridBody . nativeElement . offsetHeight ) ;
465+
462466 expect ( loadingIndicator . nativeElement . children . length ) . not . toBe ( 0 ) ;
463467
464468 // Check for empty filter grid message and body less than 100px
465469 const columns = fixture . componentInstance . grid . columnList ;
466470 grid . filter ( columns . get ( 0 ) . field , 546000 , IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) ) ;
467471 fixture . detectChanges ( ) ;
468472 tick ( 100 ) ;
469- expect ( gridBody . nativeElement . textContent ) . not . toEqual ( grid . emptyFilteredGridMessage ) ;
473+ expect ( gridBodyContent . nativeElement . textContent ) . not . toEqual ( grid . emptyFilteredGridMessage ) ;
470474
471475 // Clear filter and check if grid's body height is restored based on all loaded rows
472476 grid . clearFilter ( columns . get ( 0 ) . field ) ;
473477 fixture . detectChanges ( ) ;
474478 tick ( 100 ) ;
475- expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBeGreaterThan ( 300 ) ;
479+ expect ( parseInt ( window . getComputedStyle ( gridBodyContent . nativeElement ) . height , 10 ) ) . toBeGreaterThan ( 300 ) ;
476480
477481 // Clearing grid's data and check for empty grid message
478482 fixture . componentInstance . clearData ( ) ;
479483 fixture . detectChanges ( ) ;
480484 tick ( 100 ) ;
481485
482- loadingIndicator = gridBody . query ( By . css ( '.igx-grid__loading' ) ) ;
486+ loadingIndicator = gridBodyContent . query ( By . css ( '.igx-grid__loading' ) ) ;
483487 expect ( loadingIndicator ) . not . toBeNull ( ) ;
484488
485- // the overlay should be hidden
489+ // the overlay should be hidden and container should have the same dimensions as the grid's body
486490 loadingIndicator = gridElement . query ( By . css ( '.igx-grid__loading-outlet' ) ) ;
491+ expect ( loadingIndicator . nativeElement . offsetWidth ) . toBe ( gridBody . nativeElement . offsetWidth ) ;
492+ expect ( loadingIndicator . nativeElement . offsetHeight ) . toBe ( gridBody . nativeElement . offsetHeight ) ;
487493 expect ( loadingIndicator . nativeElement . children . length ) . toBe ( 0 ) ;
488494 } ) ) ;
489495
@@ -618,23 +624,26 @@ describe('IgxGrid Component Tests #grid', () => {
618624
619625 const grid = fixture . componentInstance . grid ;
620626 const gridElement = fixture . debugElement . query ( By . css ( '.igx-grid' ) ) ;
621- const gridBody = fixture . debugElement . query ( By . css ( TBODY_CLASS ) ) ;
622- let loadingIndicator = gridBody . query ( By . css ( '.igx-grid__loading' ) ) ;
627+ const gridBodyContent = fixture . debugElement . query ( By . css ( TBODY_CLASS ) ) ;
628+ let loadingIndicator = gridBodyContent . query ( By . css ( '.igx-grid__loading' ) ) ;
623629
624630 expect ( loadingIndicator ) . not . toBeNull ( ) ;
625- expect ( gridBody . nativeElement . textContent ) . not . toEqual ( grid . emptyFilteredGridMessage ) ;
631+ expect ( gridBodyContent . nativeElement . textContent ) . not . toEqual ( grid . emptyFilteredGridMessage ) ;
626632
627633 // Check for loaded rows in grid's container
628634 fixture . componentInstance . generateData ( 30 ) ;
629635 fixture . detectChanges ( ) ;
630636 tick ( 1000 ) ;
631- expect ( parseInt ( window . getComputedStyle ( gridBody . nativeElement ) . height , 10 ) ) . toBe ( 548 ) ;
637+ expect ( parseInt ( window . getComputedStyle ( gridBodyContent . nativeElement ) . height , 10 ) ) . toBe ( 548 ) ;
632638
633- loadingIndicator = gridBody . query ( By . css ( '.igx-grid__loading' ) ) ;
639+ loadingIndicator = gridBodyContent . query ( By . css ( '.igx-grid__loading' ) ) ;
634640 expect ( loadingIndicator ) . toBeNull ( ) ;
635641
636- // the overlay should be shown
642+ // the overlay should be shown and container should have the same dimensions as the grid's body
637643 loadingIndicator = gridElement . query ( By . css ( '.igx-grid__loading-outlet' ) ) ;
644+ const gridBody = fixture . debugElement . query ( By . css ( '.igx-grid__tbody' ) ) ;
645+ expect ( loadingIndicator . nativeElement . offsetWidth ) . toBe ( gridBody . nativeElement . offsetWidth ) ;
646+ expect ( loadingIndicator . nativeElement . offsetHeight ) . toBe ( gridBody . nativeElement . offsetHeight ) ;
638647 expect ( loadingIndicator . nativeElement . children . length ) . not . toBe ( 0 ) ;
639648
640649 grid . isLoading = false ;
@@ -647,10 +656,10 @@ describe('IgxGrid Component Tests #grid', () => {
647656 tick ( 100 ) ;
648657
649658 // isLoading is still false so the empty data message should show, not the loading indicator
650- loadingIndicator = gridBody . query ( By . css ( '.igx-grid__loading' ) ) ;
659+ loadingIndicator = gridBodyContent . query ( By . css ( '.igx-grid__loading' ) ) ;
651660 expect ( loadingIndicator ) . toBeNull ( ) ;
652661
653- expect ( gridBody . nativeElement . textContent ) . toEqual ( grid . emptyGridMessage ) ;
662+ expect ( gridBodyContent . nativeElement . textContent ) . toEqual ( grid . emptyGridMessage ) ;
654663 } ) ) ;
655664
656665 it ( 'should render empty message when grid height is 100%' , fakeAsync ( ( ) => {
0 commit comments