@@ -288,29 +288,6 @@ describe('IgxForOf directive -', () => {
288288 expect ( errorMessage ) . toBe ( '' ) ;
289289 } ) ;
290290
291- it ( 'should allow initially undefined value for igxForOf and then detect changes correctly once the value is updated' , ( ) => {
292- fix = TestBed . createComponent ( VerticalVirtualNoDataComponent ) ;
293- expect ( ( ) => {
294- fix . detectChanges ( ) ;
295- } ) . not . toThrow ( ) ;
296- displayContainer = fix . nativeElement . querySelector ( DISPLAY_CONTAINER ) ;
297- verticalScroller = fix . nativeElement . querySelector ( VERTICAL_SCROLLER ) ;
298- expect ( displayContainer ) . not . toBeNull ( ) ;
299- expect ( verticalScroller ) . not . toBeNull ( ) ;
300-
301- fix . componentInstance . height = '400px' ;
302- fix . detectChanges ( ) ;
303- fix . componentInstance . height = '500px' ;
304- fix . detectChanges ( ) ;
305-
306- let rowsRendered = displayContainer . querySelectorAll ( 'div' ) ;
307- expect ( rowsRendered . length ) . toBe ( 0 ) ;
308- fix . componentInstance . data = dg . generateVerticalData ( fix . componentInstance . cols ) ;
309- fix . detectChanges ( ) ;
310- rowsRendered = displayContainer . querySelectorAll ( 'div' ) ;
311- expect ( rowsRendered . length ) . not . toBe ( 0 ) ;
312- } ) ;
313-
314291 it ( 'should always fill available space for last chunk size calculation - vertical virtualization' , async ( ) => {
315292 fix . componentInstance . height = '1900px' ;
316293 const virtualContainer = fix . componentInstance . parentVirtDir ;
@@ -379,6 +356,49 @@ describe('IgxForOf directive -', () => {
379356 } ) ;
380357 } ) ;
381358
359+ describe ( 'vertical virtual component no data' , ( ) => {
360+ let fix : ComponentFixture < VerticalVirtualComponent > ;
361+ configureTestSuite ( ) ;
362+ beforeAll ( waitForAsync ( ( ) => {
363+ TestBed . configureTestingModule ( {
364+ declarations : [
365+ TestIgxForOfDirective ,
366+ VerticalVirtualNoDataComponent ,
367+ VerticalVirtualComponent
368+ ] ,
369+ imports : [ IgxForOfModule ] ,
370+ providers : [ { provide : NgZone , useFactory : ( ) => new TestNgZone ( ) } ]
371+ } ) . compileComponents ( ) ;
372+ } ) ) ;
373+
374+ beforeEach ( ( ) => {
375+ fix = TestBed . createComponent ( VerticalVirtualNoDataComponent ) ;
376+ } ) ;
377+
378+ it ( 'should allow initially undefined value for igxForOf and then detect changes correctly once the value is updated' , ( ) => {
379+ expect ( ( ) => {
380+ fix . detectChanges ( ) ;
381+ } ) . not . toThrow ( ) ;
382+ displayContainer = fix . nativeElement . querySelector ( DISPLAY_CONTAINER ) ;
383+ verticalScroller = fix . nativeElement . querySelector ( VERTICAL_SCROLLER ) ;
384+ expect ( displayContainer ) . not . toBeNull ( ) ;
385+ expect ( verticalScroller ) . not . toBeNull ( ) ;
386+
387+ fix . componentInstance . height = '400px' ;
388+ fix . detectChanges ( ) ;
389+ fix . componentInstance . height = '500px' ;
390+ fix . detectChanges ( ) ;
391+
392+ let rowsRendered = displayContainer . querySelectorAll ( 'div' ) ;
393+ expect ( rowsRendered . length ) . toBe ( 0 ) ;
394+ fix . componentInstance . data = dg . generateVerticalData ( fix . componentInstance . cols ) ;
395+ fix . detectChanges ( ) ;
396+ rowsRendered = displayContainer . querySelectorAll ( 'div' ) ;
397+ expect ( rowsRendered . length ) . not . toBe ( 0 ) ;
398+ } ) ;
399+
400+ } ) ;
401+
382402 describe ( 'vertical and horizontal virtual component' , ( ) => {
383403 let fix : ComponentFixture < VirtualComponent > ;
384404
0 commit comments