Skip to content

Commit

Permalink
tests(date-field): increase tests coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasAuger committed Feb 27, 2020
1 parent 11a8512 commit 47b41cf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/DateField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,22 @@ describe('<DateField />', () => {
expect(value.getMonth()).toBe(11);
expect(value.getDate()).toBe(17);
});

it('should add formated "min" and "max" prop to native date input', () => {
const day = new Date('December 16, 2019');
const nextDay = new Date('December 17, 2019');
const component = mount(
<DateField
minDate={day}
maxDate={nextDay}
value={nextDay}
native={true}
/>
);

const field = component.find('input[type="date"]');
expect(field.prop('min')).toBe('2019-12-16');
expect(field.prop('max')).toBe('2019-12-17');
});

});

0 comments on commit 47b41cf

Please sign in to comment.