Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Mar 5, 2018
1 parent 2704474 commit a66eab2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/daypickerinput/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ describe('DayPickerInput', () => {
input.simulate('change', { target: { value: 'foo' } });
expect(wrapper.find('input')).toHaveProp('value', 'foo');
});
it('should not call `onDayChange` if the value is not a valid date', () => {
it('should call `onDayChange` with `undefined` if the value is not a valid date', () => {
const onDayChange = jest.fn();
const wrapper = mount(<DayPickerInput onDayChange={onDayChange} />);
const input = wrapper.find('input');
input.simulate('change', { target: { value: 'foo' } });
expect(onDayChange).not.toHaveBeenCalled();
expect(onDayChange).toHaveBeenCalledWith(undefined, {});
});
it("should update the input's value and the displayed month", () => {
const wrapper = mount(<DayPickerInput />);
Expand Down

0 comments on commit a66eab2

Please sign in to comment.