Skip to content

Commit f95cdd6

Browse files
committed
test(drp): add test for reset with required & previous value
1 parent ebc97da commit f95cdd6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/components/date-range-picker/date-range-picker.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,6 +1857,19 @@ describe('Date range picker', () => {
18571857
expect(dateTimeInputs[1].value).to.equal(null);
18581858
});
18591859

1860+
it('should not be in invalid state on reset for a required control which previously had value', async () => {
1861+
spec.setProperties({ value: value });
1862+
spec.setProperties({ required: true });
1863+
1864+
spec.assertSubmitPasses();
1865+
await checkInputsInvalidState(spec.element, false, false);
1866+
1867+
spec.setProperties({ value: null });
1868+
1869+
spec.reset();
1870+
await checkInputsInvalidState(spec.element, false, false);
1871+
});
1872+
18601873
it('should not be in invalid state on reset for a required control with no value', async () => {
18611874
spec.setProperties({ value: null });
18621875
spec.setProperties({ required: true });

0 commit comments

Comments
 (0)