mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-26 01:42:30 +08:00
9a9db14b4c
* use less variables in calendar style * Make calendar selectable * Add test case * fix test typo * update demo title
18 lines
522 B
JavaScript
18 lines
522 B
JavaScript
import React from 'react';
|
|
import Moment from 'moment';
|
|
import { mount } from 'enzyme';
|
|
import Calendar from '..';
|
|
|
|
describe('Calendar', () => {
|
|
it('Calendar should be selectable', () => {
|
|
const onSelect = jest.fn();
|
|
const wrapper = mount(
|
|
<Calendar onSelect={onSelect} />
|
|
);
|
|
wrapper.find('.ant-fullcalendar-cell').at(0).simulate('click');
|
|
expect(onSelect).toBeCalledWith(expect.anything());
|
|
const value = onSelect.mock.calls[0][0];
|
|
expect(Moment.isMoment(value)).toBe(true);
|
|
});
|
|
});
|