@@ -405,6 +405,34 @@ describe('nested MdTabGroup with enabled animations', () => {
405
405
} ) ;
406
406
407
407
408
+ describe ( 'lazy loaded tabs' , ( ) => {
409
+ beforeEach ( async ( ( ) => {
410
+ TestBed . configureTestingModule ( {
411
+ imports : [ MdTabsModule , BrowserAnimationsModule ] ,
412
+ declarations : [ TemplateTabs ]
413
+ } ) ;
414
+
415
+ TestBed . compileComponents ( ) ;
416
+ } ) ) ;
417
+
418
+ it ( 'should lazy load the second tab' , ( done ) => {
419
+ let fixture = TestBed . createComponent ( TemplateTabs ) ;
420
+ fixture . detectChanges ( ) ;
421
+
422
+ let tabLabel = fixture . debugElement . queryAll ( By . css ( '.mat-tab-label' ) ) [ 1 ] ;
423
+ tabLabel . nativeElement . click ( ) ;
424
+ fixture . detectChanges ( ) ;
425
+
426
+ fixture . whenStable ( ) . then ( ( ) => {
427
+ fixture . detectChanges ( ) ;
428
+ let child = fixture . debugElement . query ( By . css ( '.child' ) ) ;
429
+ expect ( child . nativeElement ) . toBeDefined ( ) ;
430
+ done ( ) ;
431
+ } ) ;
432
+ } ) ;
433
+ } ) ;
434
+
435
+
408
436
@Component ( {
409
437
template : `
410
438
<md-tab-group class="tab-group"
@@ -583,3 +611,20 @@ class TabGroupWithSimpleApi {
583
611
} )
584
612
class NestedTabs { }
585
613
614
+
615
+ @Component ( {
616
+ selector : 'template-tabs' ,
617
+ template : `
618
+ <md-tab-group>
619
+ <md-tab label="One">
620
+ Eager
621
+ </md-tab>
622
+ <md-tab label="Two">
623
+ <ng-template mdTabContent>
624
+ <div class="child">Hi</div>
625
+ </ng-template>
626
+ </md-tab>
627
+ </md-tab-group>
628
+ ` ,
629
+ } )
630
+ class TemplateTabs { }
0 commit comments