Fixed wrong value passed to DateInput

This commit is contained in:
Alejandro Celaya 2018-08-12 10:18:26 +02:00
parent e0ab67899d
commit d6e6c8c6c2

View file

@ -2,6 +2,7 @@ import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import DateInput from '../../src/common/DateInput'; import DateInput from '../../src/common/DateInput';
import FontAwesomeIcon from '@fortawesome/react-fontawesome'; import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import moment from 'moment';
describe('<DateInput />', () => { describe('<DateInput />', () => {
let wrapped; let wrapped;
@ -32,7 +33,7 @@ describe('<DateInput />', () => {
}); });
it('does not show calendar icon when input is clearable', () => { it('does not show calendar icon when input is clearable', () => {
wrapped = createComponent({ isClearable: true, selected: '' }); wrapped = createComponent({ isClearable: true, selected: moment() });
expect(wrapped.find(FontAwesomeIcon)).toHaveLength(0); expect(wrapped.find(FontAwesomeIcon)).toHaveLength(0);
}); });
}); });