@@ -44,10 +44,6 @@ describe('MdToolbar', () => {
4444      expect ( toolbarElement . classList . contains ( 'mat-warn' ) ) . toBe ( true ) ; 
4545    } ) ; 
4646
47-     it ( 'should set the toolbar role on the host' ,  ( )  =>  { 
48-       expect ( toolbarElement . getAttribute ( 'role' ) ) . toBe ( 'toolbar' ) ; 
49-     } ) ; 
50- 
5147    it ( 'should not wrap the first row contents inside of a generated element' ,  ( )  =>  { 
5248      expect ( toolbarElement . firstElementChild ! . tagName ) . toBe ( 'SPAN' , 
5349          'Expected the <span> element of the first row to be a direct child of the toolbar' ) ; 
@@ -70,6 +66,18 @@ describe('MdToolbar', () => {
7066        fixture . detectChanges ( ) ; 
7167      } ) . toThrowError ( / a t t e m p t i n g   t o   c o m b i n e   d i f f e r e n t / i) ; 
7268    } ) ; 
69+ 
70+     it ( 'should throw an error if a toolbar-row is added later' ,  ( )  =>  { 
71+       const  fixture  =  TestBed . createComponent ( ToolbarMixedRowModes ) ; 
72+ 
73+       fixture . componentInstance . showToolbarRow  =  false ; 
74+       fixture . detectChanges ( ) ; 
75+ 
76+       expect ( ( )  =>  { 
77+         fixture . componentInstance . showToolbarRow  =  true ; 
78+         fixture . detectChanges ( ) ; 
79+       } ) . toThrowError ( / a t t e m p t i n g   t o   c o m b i n e   d i f f e r e n t / i) ; 
80+     } ) ; 
7381  } ) ; 
7482
7583} ) ; 
@@ -100,8 +108,10 @@ class ToolbarMultipleRows {}
100108  template : ` 
101109    <md-toolbar> 
102110      First Row 
103-       <md-toolbar-row>Second Row</md-toolbar-row> 
111+       <md-toolbar-row *ngIf="showToolbarRow" >Second Row</md-toolbar-row> 
104112    </md-toolbar> 
105113  ` 
106114} ) 
107- class  ToolbarMixedRowModes  { } 
115+ class  ToolbarMixedRowModes  { 
116+   showToolbarRow : boolean  =  true ; 
117+ } 
0 commit comments