@@ -1145,7 +1145,7 @@ describe('MdAutocomplete', () => {
1145
1145
1146
1146
const overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
1147
1147
// Firefox, edge return a decimal value for width, so we need to parse and round it to verify
1148
- expect ( Math . ceil ( parseFloat ( overlayPane . style . width ) ) ) . toEqual ( 300 ) ;
1148
+ expect ( Math . ceil ( parseFloat ( overlayPane . style . width ) ) ) . toBe ( 300 ) ;
1149
1149
1150
1150
widthFixture . componentInstance . trigger . closePanel ( ) ;
1151
1151
widthFixture . detectChanges ( ) ;
@@ -1157,8 +1157,31 @@ describe('MdAutocomplete', () => {
1157
1157
widthFixture . detectChanges ( ) ;
1158
1158
1159
1159
// Firefox, edge return a decimal value for width, so we need to parse and round it to verify
1160
- expect ( Math . ceil ( parseFloat ( overlayPane . style . width ) ) ) . toEqual ( 500 ) ;
1160
+ expect ( Math . ceil ( parseFloat ( overlayPane . style . width ) ) ) . toBe ( 500 ) ;
1161
+ } ) ;
1162
+
1163
+ it ( 'should update the width while the panel is open' , ( ) => {
1164
+ const widthFixture = TestBed . createComponent ( SimpleAutocomplete ) ;
1165
+
1166
+ widthFixture . componentInstance . width = 300 ;
1167
+ widthFixture . detectChanges ( ) ;
1168
+
1169
+ widthFixture . componentInstance . trigger . openPanel ( ) ;
1170
+ widthFixture . detectChanges ( ) ;
1171
+
1172
+ const overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
1173
+ const input = widthFixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
1174
+
1175
+ expect ( Math . ceil ( parseFloat ( overlayPane . style . width ) ) ) . toBe ( 300 ) ;
1176
+
1177
+ widthFixture . componentInstance . width = 500 ;
1178
+ widthFixture . detectChanges ( ) ;
1179
+
1180
+ input . focus ( ) ;
1181
+ dispatchFakeEvent ( input , 'input' ) ;
1182
+ widthFixture . detectChanges ( ) ;
1161
1183
1184
+ expect ( Math . ceil ( parseFloat ( overlayPane . style . width ) ) ) . toBe ( 500 ) ;
1162
1185
} ) ;
1163
1186
1164
1187
it ( 'should show the panel when the options are initialized later within a component with ' +
0 commit comments