mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
✅ fix Carousel test case
This commit is contained in:
parent
5e99ed7bbe
commit
9095189bcf
@ -116,6 +116,11 @@ describe('Carousel', () => {
|
||||
});
|
||||
|
||||
it('should keep initialSlide', () => {
|
||||
// react unsafe lifecycle don't works in React 15
|
||||
// https://github.com/akiran/react-slick/commit/97988e897750e1d8f7b10a86b655f50d75d38298
|
||||
if (process.env.REACT === '15') {
|
||||
return;
|
||||
}
|
||||
const wrapper = mount(<Carousel initialSlide={1} />);
|
||||
wrapper.setProps({
|
||||
children: [<div key="1" />, <div key="2" />, <div key="3" />],
|
||||
|
@ -1,7 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import debounce from 'lodash/debounce';
|
||||
import { Settings } from 'react-slick';
|
||||
import { polyfill } from 'react-lifecycles-compat';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
@ -22,7 +21,7 @@ if (typeof window !== 'undefined') {
|
||||
// make sure matchMedia polyfill run before require('react-slick')
|
||||
// Fix https://github.com/ant-design/ant-design/issues/6560
|
||||
// Fix https://github.com/ant-design/ant-design/issues/3308
|
||||
const SlickCarousel = polyfill(require('react-slick').default);
|
||||
const SlickCarousel = require('react-slick').default;
|
||||
|
||||
export type CarouselEffect = 'scrollx' | 'fade';
|
||||
export type DotPosition = 'top' | 'bottom' | 'left' | 'right';
|
||||
|
@ -90,7 +90,7 @@
|
||||
"rc-util": "^4.6.0",
|
||||
"react-lazy-load": "^3.0.13",
|
||||
"react-lifecycles-compat": "^3.0.4",
|
||||
"react-slick": "~0.25.0",
|
||||
"react-slick": "~0.25.2",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"shallowequal": "^1.1.0",
|
||||
"warning": "~4.0.3"
|
||||
|
Loading…
Reference in New Issue
Block a user