test: add more test cases (#26362)

This commit is contained in:
偏右 2020-08-24 11:50:53 +08:00 committed by GitHub
parent 9b6db94fdf
commit fbef76e943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10135 additions and 5091 deletions

View File

@ -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', () => {

View File

@ -46,6 +46,7 @@ import jaJP from '../ja_JP';
import knIN from '../kn_IN';
import koKR from '../ko_KR';
import kmrIQ from '../kmr_IQ';
import kuIQ from '../ku_IQ';
import lvLV from '../lv_LV';
import ltLT from '../lt_LT';
import mkMK from '../mk_MK';
@ -103,6 +104,7 @@ const locales = [
knIN,
koKR,
kmrIQ,
kuIQ,
ltLT,
mkMK,
msMY,