Skip to content

Commit c529926

Browse files
author
Caleb Kish
committed
update test
1 parent d8ac272 commit c529926

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/material/timepicker/timepicker.spec.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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(/MatTimepicker can only be registered with one input at a time/);
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

Comments
 (0)