@@ -44,10 +44,6 @@ describe('MdToolbar', () => {
44
44
expect ( toolbarElement . classList . contains ( 'mat-warn' ) ) . toBe ( true ) ;
45
45
} ) ;
46
46
47
- it ( 'should set the toolbar role on the host' , ( ) => {
48
- expect ( toolbarElement . getAttribute ( 'role' ) ) . toBe ( 'toolbar' ) ;
49
- } ) ;
50
-
51
47
it ( 'should not wrap the first row contents inside of a generated element' , ( ) => {
52
48
expect ( toolbarElement . firstElementChild ! . tagName ) . toBe ( 'SPAN' ,
53
49
'Expected the <span> element of the first row to be a direct child of the toolbar' ) ;
@@ -70,6 +66,18 @@ describe('MdToolbar', () => {
70
66
fixture . detectChanges ( ) ;
71
67
} ) . 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) ;
72
68
} ) ;
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
+ } ) ;
73
81
} ) ;
74
82
75
83
} ) ;
@@ -100,8 +108,10 @@ class ToolbarMultipleRows {}
100
108
template : `
101
109
<md-toolbar>
102
110
First Row
103
- <md-toolbar-row>Second Row</md-toolbar-row>
111
+ <md-toolbar-row *ngIf="showToolbarRow" >Second Row</md-toolbar-row>
104
112
</md-toolbar>
105
113
`
106
114
} )
107
- class ToolbarMixedRowModes { }
115
+ class ToolbarMixedRowModes {
116
+ showToolbarRow : boolean = true ;
117
+ }
0 commit comments