11import {
22 async , fakeAsync , tick , ComponentFixture , TestBed
33} from '@angular/core/testing' ;
4- import { MdTabGroup , MdTabsModule } from './tab-group' ;
4+ import { MdTabGroup , MdTabsModule , MdTabHeaderPosition } from './tab-group' ;
55import { Component , ViewChild } from '@angular/core' ;
66import { By } from '@angular/platform-browser' ;
77import { Observable } from 'rxjs/Observable' ;
@@ -247,6 +247,17 @@ describe('MdTabGroup', () => {
247247 it ( 'should support @ViewChild in the tab content' , ( ) => {
248248 expect ( fixture . componentInstance . legumes ) . toBeTruthy ( ) ;
249249 } ) ;
250+
251+ it ( 'should support setting the header position' , ( ) => {
252+ let tabGroupNode = fixture . debugElement . query ( By . css ( 'md-tab-group' ) ) . nativeElement ;
253+
254+ expect ( tabGroupNode . classList ) . not . toContain ( 'md-tab-group-inverted-header' ) ;
255+
256+ tabGroup . headerPosition = 'below' ;
257+ fixture . detectChanges ( ) ;
258+
259+ expect ( tabGroupNode . classList ) . toContain ( 'md-tab-group-inverted-header' ) ;
260+ } ) ;
250261 } ) ;
251262
252263 /**
@@ -282,6 +293,7 @@ describe('MdTabGroup', () => {
282293 template : `
283294 <md-tab-group class="tab-group"
284295 [(selectedIndex)]="selectedIndex"
296+ [headerPosition]="headerPosition"
285297 (focusChange)="handleFocus($event)"
286298 (selectChange)="handleSelection($event)">
287299 <md-tab>
@@ -303,6 +315,7 @@ class SimpleTabsTestApp {
303315 selectedIndex : number = 1 ;
304316 focusEvent : any ;
305317 selectEvent : any ;
318+ headerPosition : MdTabHeaderPosition = 'above' ;
306319 handleFocus ( event : any ) {
307320 this . focusEvent = event ;
308321 }
0 commit comments