|
3 | 3 | } from '@angular/core/testing';
|
4 | 4 | import {MdTabGroup, MdTabsModule, MdTabHeaderPosition} from './index';
|
5 | 5 | import {Component, ViewChild} from '@angular/core';
|
6 |
| -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; |
| 6 | +import {NoopAnimationsModule, BrowserAnimationsModule} from '@angular/platform-browser/animations'; |
7 | 7 | import {By} from '@angular/platform-browser';
|
8 | 8 | import {Observable} from 'rxjs/Observable';
|
9 | 9 | import {MdTab} from './tab';
|
@@ -290,6 +290,26 @@ describe('MdTabGroup', () => {
|
290 | 290 | }
|
291 | 291 | });
|
292 | 292 |
|
| 293 | + |
| 294 | +describe('nested MdTabGroup with enabled animations', () => { |
| 295 | + beforeEach(async(() => { |
| 296 | + TestBed.configureTestingModule({ |
| 297 | + imports: [MdTabsModule.forRoot(), BrowserAnimationsModule], |
| 298 | + declarations: [NestedTabs] |
| 299 | + }); |
| 300 | + |
| 301 | + TestBed.compileComponents(); |
| 302 | + })); |
| 303 | + |
| 304 | + it('should not throw when creating a component with nested tab groups', async(() => { |
| 305 | + expect(() => { |
| 306 | + let fixture = TestBed.createComponent(NestedTabs); |
| 307 | + fixture.detectChanges(); |
| 308 | + }).not.toThrow(); |
| 309 | + })); |
| 310 | +}); |
| 311 | + |
| 312 | + |
293 | 313 | @Component({
|
294 | 314 | template: `
|
295 | 315 | <md-tab-group class="tab-group"
|
@@ -443,3 +463,22 @@ class TabGroupWithSimpleApi {
|
443 | 463 | otherContent = 'Apples, grapes';
|
444 | 464 | @ViewChild('legumes') legumes: any;
|
445 | 465 | }
|
| 466 | + |
| 467 | + |
| 468 | +@Component({ |
| 469 | + selector: 'nested-tabs', |
| 470 | + template: ` |
| 471 | + <md-tab-group> |
| 472 | + <md-tab label="One">Tab one content</md-tab> |
| 473 | + <md-tab label="Two"> |
| 474 | + Tab two content |
| 475 | + <md-tab-group [dynamicHeight]="true"> |
| 476 | + <md-tab label="Inner tab one">Inner content one</md-tab> |
| 477 | + <md-tab label="Inner tab two">Inner content two</md-tab> |
| 478 | + </md-tab-group> |
| 479 | + </md-tab> |
| 480 | + </md-tab-group> |
| 481 | + `, |
| 482 | +}) |
| 483 | +class NestedTabs {} |
| 484 | + |
0 commit comments