From 0097d34d013b8422a7a471fb2ffbbac77db850a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 2 Sep 2020 18:30:27 +0800 Subject: [PATCH] fix: Update `rc-motion` deps & fix ssr (#26542) * chore: Update rc-motion deps * frame wheel not prevent scroll * update ts --- components/_util/motion.tsx | 3 +- .../__snapshots__/type.test.tsx.snap | 52 +- components/button/__tests__/type.test.tsx | 16 +- .../__snapshots__/index.test.js.snap | 1140 +++-------------- components/cascader/__tests__/index.test.js | 6 +- package.json | 2 +- 6 files changed, 160 insertions(+), 1059 deletions(-) diff --git a/components/_util/motion.tsx b/components/_util/motion.tsx index f9c5a7f431..1c58df584e 100644 --- a/components/_util/motion.tsx +++ b/components/_util/motion.tsx @@ -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 }); diff --git a/components/button/__tests__/__snapshots__/type.test.tsx.snap b/components/button/__tests__/__snapshots__/type.test.tsx.snap index 0fb8c86a6d..b3836621c7 100644 --- a/components/button/__tests__/__snapshots__/type.test.tsx.snap +++ b/components/button/__tests__/__snapshots__/type.test.tsx.snap @@ -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`] = ` - - - +, ); - 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(