@@ -131,26 +131,51 @@ describe('property bindings', () => {
131
131
132
132
it ( 'should bind ARIA properties to their corresponding attributes' , ( ) => {
133
133
@Component ( {
134
- template :'<button [ariaLabel]="label"></button>' ,
134
+ template :'<button [ariaLabel]="label" [ariaHasPopup]="hasPopup" ></button>' ,
135
135
} )
136
136
class MyComp {
137
137
label ?:string ;
138
+ hasPopup ?:string ;
138
139
}
139
140
140
141
const fixture = TestBed . createComponent ( MyComp ) ;
141
142
const button = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
142
143
143
144
fixture . componentInstance . label = 'Open' ;
145
+ fixture . componentInstance . hasPopup = 'menu' ;
144
146
fixture . detectChanges ( ) ;
145
147
146
148
expect ( button . getAttribute ( 'aria-label' ) ) . toBe ( 'Open' ) ;
149
+ expect ( button . getAttribute ( 'aria-haspopup' ) ) . toBe ( 'menu' ) ;
147
150
148
151
fixture . componentInstance . label = 'Close' ;
149
152
fixture . detectChanges ( ) ;
150
153
151
154
expect ( button . getAttribute ( 'aria-label' ) ) . toBe ( 'Close' ) ;
152
155
} ) ;
153
156
157
+ it ( 'should bind interpolated ARIA attributes' , ( ) => {
158
+ @Component ( {
159
+ template :'<button aria-label="{{label}} menu"></button>' ,
160
+ } )
161
+ class MyComp {
162
+ label ?:string ;
163
+ }
164
+
165
+ const fixture = TestBed . createComponent ( MyComp ) ;
166
+ const button = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
167
+
168
+ fixture . componentInstance . label = 'Open' ;
169
+ fixture . detectChanges ( ) ;
170
+
171
+ expect ( button . getAttribute ( 'aria-label' ) ) . toBe ( 'Open menu' ) ;
172
+
173
+ fixture . componentInstance . label = 'Close' ;
174
+ fixture . detectChanges ( ) ;
175
+
176
+ expect ( button . getAttribute ( 'aria-label' ) ) . toBe ( 'Close menu' ) ;
177
+ } ) ;
178
+
154
179
describe ( 'should bind to ARIA attribute names' , ( ) => {
155
180
it ( 'on HTML elements' , ( ) => {
156
181
@Component ( {