Skip to content

Commit

Permalink
test: add more test cases (ant-design#26362)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Aug 24, 2020
1 parent 9b6db94 commit fbef76e
Show file tree
Hide file tree
Showing 3 changed files with 6,044 additions and 1,000 deletions.
4 changes: 3 additions & 1 deletion components/calendar/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ describe('Calendar', () => {

it('Calendar should be selectable', () => {
const onSelect = jest.fn();
const wrapper = mount(<Calendar onSelect={onSelect} />);
const onChange = jest.fn();
const wrapper = mount(<Calendar onSelect={onSelect} onChange={onChange} />);
wrapper.find('.ant-picker-cell').at(0).simulate('click');
expect(onSelect).toHaveBeenCalledWith(expect.anything());
const value = onSelect.mock.calls[0][0];
expect(Moment.isMoment(value)).toBe(true);
expect(onChange).toHaveBeenCalled();
});

it('only Valid range should be selectable', () => {
Expand Down
Loading

0 comments on commit fbef76e

Please sign in to comment.