diff --git a/components/calendar/__tests__/index.test.js b/components/calendar/__tests__/index.test.js index b088761a41..63231df31c 100644 --- a/components/calendar/__tests__/index.test.js +++ b/components/calendar/__tests__/index.test.js @@ -168,10 +168,7 @@ describe('Calendar', () => { const wrapper = mount(); expect(wrapper).toMatchSnapshot(); expect(wrapper.state().mode).toBe('month'); - wrapper - .find('.ant-radio-button-input') - .at(1) - .simulate('change'); + wrapper.find('.ant-radio-button-input[value="year"]').simulate('change'); expect(wrapper).toMatchSnapshot(); expect(onPanelChange).toBeCalled(); expect(onPanelChange.mock.calls[0][1]).toEqual('year');