@@ -150,14 +150,6 @@ describe('MatTimepicker', () => {
150150 expect ( input . value ) . toBe ( '9:31 AM' ) ;
151151 } ) ;
152152
153- it ( 'should not format input value when focused and in shadow DOM' , ( ) => {
154- const fixture = TestBed . createComponent ( TimepickerInShadowDom ) ;
155- const input = getInput ( fixture ) ;
156- typeInElement ( input , '13:37' ) ;
157- fixture . detectChanges ( ) ;
158- expect ( input . value ) . toBe ( '13:37' ) ;
159- } ) ;
160-
161153 it ( 'should reformat the input value when the locale changes' , ( ) => {
162154 const fixture = TestBed . createComponent ( StandaloneTimepicker ) ;
163155 const input = getInput ( fixture ) ;
@@ -307,6 +299,15 @@ describe('MatTimepicker', () => {
307299 fixture . detectChanges ( ) ;
308300 } ) . toThrowError ( / M a t T i m e p i c k e r c a n o n l y b e r e g i s t e r e d w i t h o n e i n p u t a t a t i m e / ) ;
309301 } ) ;
302+
303+ it ( 'input should be properly formatted when in shadow DOM' , ( ) => {
304+ const fixture = TestBed . createComponent ( TimepickerInShadowDom ) ;
305+ fixture . detectChanges ( ) ; // So that TimepickerInput.timepicker gets set.
306+ const input = fixture . nativeElement . shadowRoot . querySelector ( '.mat-timepicker-input' ) ;
307+ typeInElement ( input , '13:37' ) ;
308+ fixture . detectChanges ( ) ;
309+ expect ( input . value ) . toBe ( '13:37' ) ;
310+ } ) ;
310311 } ) ;
311312
312313 describe ( 'opening and closing' , ( ) => {
0 commit comments