From 782881e3ca0747b6b96847bcbcfb5e3d82e3c8e2 Mon Sep 17 00:00:00 2001 From: zombiej Date: Sun, 4 Nov 2018 19:44:10 +0800 Subject: [PATCH] add test case for month picker --- .../date-picker/__tests__/MonthPicker.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/date-picker/__tests__/MonthPicker.test.js b/components/date-picker/__tests__/MonthPicker.test.js index 51d11d7620..2056ec9347 100644 --- a/components/date-picker/__tests__/MonthPicker.test.js +++ b/components/date-picker/__tests__/MonthPicker.test.js @@ -1,8 +1,21 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import moment from 'moment'; import DatePicker from '..'; import focusTest from '../../../tests/shared/focusTest'; +import { openPanel } from './utils'; const { MonthPicker } = DatePicker; describe('MonthPicker', () => { focusTest(MonthPicker); + + it('reset select item when popup close', () => { + const wrapper = mount( + + ); + openPanel(wrapper); + wrapper.find('.ant-calendar-month-panel-month').first().simulate('click'); + wrapper.find('.ant-calendar-month-panel-cell').at(6).hasClass('ant-calendar-month-panel-selected-cell'); + }); });