fix: Update `rc-motion` deps & fix ssr (#26542)

* chore: Update rc-motion deps

* frame wheel not prevent scroll

* update ts
pull/26549/head
二货机器人 4 years ago committed by GitHub
parent b5d9580565
commit 0097d34d01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,4 @@
import { CSSMotionProps } from 'rc-motion'; import { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';
import { MotionEventHandler, MotionEndEventHandler } from 'rc-motion/lib/CSSMotion';
// ================== Collapse Motion ================== // ================== Collapse Motion ==================
const getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 }); const getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 });

@ -291,54 +291,10 @@ exports[`Button should not render as link button when href is undefined 1`] = `
`; `;
exports[`Button should render empty button without errors 1`] = ` exports[`Button should render empty button without errors 1`] = `
<Button <button
block={false} class="ant-btn"
ghost={false} type="button"
htmlType="button" />
loading={false}
>
<Wave>
<button
className="ant-btn"
onClick={[Function]}
type="button"
>
<LoadingIcon
existIcon={false}
loading={false}
prefixCls="ant-btn"
>
<ForwardRef
motionName="ant-btn-loading-icon-motion"
onAppearActive={[Function]}
onAppearStart={[Function]}
onEnterActive={[Function]}
onEnterStart={[Function]}
onLeaveActive={[Function]}
onLeaveStart={[Function]}
removeOnLeave={true}
visible={false}
>
<CSSMotion
internalRef={null}
motionAppear={true}
motionEnter={true}
motionLeave={true}
motionName="ant-btn-loading-icon-motion"
onAppearActive={[Function]}
onAppearStart={[Function]}
onEnterActive={[Function]}
onEnterStart={[Function]}
onLeaveActive={[Function]}
onLeaveStart={[Function]}
removeOnLeave={true}
visible={false}
/>
</ForwardRef>
</LoadingIcon>
</button>
</Wave>
</Button>
`; `;
exports[`Button should support link button 1`] = ` exports[`Button should support link button 1`] = `

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { mount, render } from 'enzyme'; import { mount, render } from 'enzyme';
import { act } from 'react-dom/test-utils'; import { act } from 'react-dom/test-utils';
import { SearchOutlined } from '@ant-design/icons'; import { SearchOutlined } from '@ant-design/icons';
import { resetWarned } from 'rc-util/lib/warning' import { resetWarned } from 'rc-util/lib/warning';
import Button from '..'; import Button from '..';
import ConfigProvider from '../../config-provider'; import ConfigProvider from '../../config-provider';
import mountTest from '../../../tests/shared/mountTest'; import mountTest from '../../../tests/shared/mountTest';
@ -111,7 +111,7 @@ describe('Button', () => {
{undefined} {undefined}
</Button>, </Button>,
); );
expect(wrapper).toMatchSnapshot(); expect(wrapper.render()).toMatchSnapshot();
}); });
it('have static property for type detecting', () => { it('have static property for type detecting', () => {
@ -282,7 +282,7 @@ describe('Button', () => {
}); });
it('should warning when pass a string as icon props', () => { it('should warning when pass a string as icon props', () => {
resetWarned() resetWarned();
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
mount(<Button type="primary" icon="ab" />); mount(<Button type="primary" icon="ab" />);
expect(warnSpy).not.toHaveBeenCalled(); expect(warnSpy).not.toHaveBeenCalled();
@ -294,24 +294,24 @@ describe('Button', () => {
}); });
it('should warning when pass type=link and ghost=true', () => { it('should warning when pass type=link and ghost=true', () => {
resetWarned() resetWarned();
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
mount(<Button type="link" ghost />); mount(<Button type="link" ghost />);
expect(warnSpy).toHaveBeenCalledWith( expect(warnSpy).toHaveBeenCalledWith(
"Warning: [antd: Button] `link` or `text` button can't be a `ghost` button.", "Warning: [antd: Button] `link` or `text` button can't be a `ghost` button.",
); );
warnSpy.mockRestore(); warnSpy.mockRestore();
}) });
it('should warning when pass type=text and ghost=true', () => { it('should warning when pass type=text and ghost=true', () => {
resetWarned() resetWarned();
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
mount(<Button type="text" ghost />); mount(<Button type="text" ghost />);
expect(warnSpy).toHaveBeenCalledWith( expect(warnSpy).toHaveBeenCalledWith(
"Warning: [antd: Button] `link` or `text` button can't be a `ghost` button.", "Warning: [antd: Button] `link` or `text` button can't be a `ghost` button.",
); );
warnSpy.mockRestore(); warnSpy.mockRestore();
}) });
it('skip check 2 words when ConfigProvider disable this', () => { it('skip check 2 words when ConfigProvider disable this', () => {
const wrapper = mount( const wrapper = mount(

@ -134,7 +134,7 @@ describe('Cascader', () => {
wrapper.find('input').simulate('change', { target: { value: 'z' } }); wrapper.find('input').simulate('change', { target: { value: 'z' } });
expect(wrapper.state('inputValue')).toBe('z'); expect(wrapper.state('inputValue')).toBe('z');
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
expect(popupWrapper).toMatchSnapshot(); expect(popupWrapper.render()).toMatchSnapshot();
}); });
it('should highlight keyword and filter when search in Cascader with same field name of label and value', () => { it('should highlight keyword and filter when search in Cascader with same field name of label and value', () => {
@ -184,7 +184,7 @@ describe('Cascader', () => {
wrapper.find('input').simulate('change', { target: { value: '__notfoundkeyword__' } }); wrapper.find('input').simulate('change', { target: { value: '__notfoundkeyword__' } });
expect(wrapper.state('inputValue')).toBe('__notfoundkeyword__'); expect(wrapper.state('inputValue')).toBe('__notfoundkeyword__');
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
expect(popupWrapper).toMatchSnapshot(); expect(popupWrapper.render()).toMatchSnapshot();
}); });
it('should support to clear selection', async () => { it('should support to clear selection', async () => {
@ -318,7 +318,7 @@ describe('Cascader', () => {
const wrapper = mount(<Cascader options={customerOptions} />); const wrapper = mount(<Cascader options={customerOptions} />);
wrapper.find('input').simulate('click'); wrapper.find('input').simulate('click');
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent()); const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
expect(popupWrapper).toMatchSnapshot(); expect(popupWrapper.render()).toMatchSnapshot();
}); });
describe('limit filtered item count', () => { describe('limit filtered item count', () => {

@ -129,7 +129,7 @@
"rc-input-number": "~6.0.0", "rc-input-number": "~6.0.0",
"rc-mentions": "~1.4.0", "rc-mentions": "~1.4.0",
"rc-menu": "~8.5.2", "rc-menu": "~8.5.2",
"rc-motion": "^1.0.0", "rc-motion": "^1.1.1",
"rc-notification": "~4.4.0", "rc-notification": "~4.4.0",
"rc-pagination": "~3.0.3", "rc-pagination": "~3.0.3",
"rc-picker": "~2.0.6", "rc-picker": "~2.0.6",

Loading…
Cancel
Save