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

* chore: Update rc-motion deps

* frame wheel not prevent scroll

* update ts
This commit is contained in:
二货机器人 2020-09-02 18:30:27 +08:00 committed by GitHub
parent b5d9580565
commit 0097d34d01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 160 additions and 1059 deletions

View File

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

View File

@ -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`] = `
<Button
block={false}
ghost={false}
htmlType="button"
loading={false}
>
<Wave>
<button
className="ant-btn"
onClick={[Function]}
class="ant-btn"
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`] = `

View File

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

View File

@ -134,7 +134,7 @@ describe('Cascader', () => {
wrapper.find('input').simulate('change', { target: { value: 'z' } });
expect(wrapper.state('inputValue')).toBe('z');
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', () => {
@ -184,7 +184,7 @@ describe('Cascader', () => {
wrapper.find('input').simulate('change', { target: { value: '__notfoundkeyword__' } });
expect(wrapper.state('inputValue')).toBe('__notfoundkeyword__');
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
expect(popupWrapper).toMatchSnapshot();
expect(popupWrapper.render()).toMatchSnapshot();
});
it('should support to clear selection', async () => {
@ -318,7 +318,7 @@ describe('Cascader', () => {
const wrapper = mount(<Cascader options={customerOptions} />);
wrapper.find('input').simulate('click');
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
expect(popupWrapper).toMatchSnapshot();
expect(popupWrapper.render()).toMatchSnapshot();
});
describe('limit filtered item count', () => {

View File

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