diff --git a/components/breadcrumb/__tests__/router.test.js b/components/breadcrumb/__tests__/router.test.js index efacfa5892..7ccd0e1728 100644 --- a/components/breadcrumb/__tests__/router.test.js +++ b/components/breadcrumb/__tests__/router.test.js @@ -22,37 +22,6 @@ const breadcrumbNameMap = { '/apps/2/detail': 'Detail', }; -const Home = withRouter(props => { - const { location, history } = props; - const pathSnippets = location.pathname.split('/').filter(i => i); - const extraBreadcrumbItems = pathSnippets.map((_, index) => { - const url = `/${pathSnippets.slice(0, index + 1).join('/')}`; - return ( - - {breadcrumbNameMap[url]} - - ); - }); - const breadcrumbItems = [ - - Home - , - ].concat(extraBreadcrumbItems); - return ( -
-
- history.push('/')}>Home - history.push('/apps')}>Application List -
- - - Home Page} /> - - {breadcrumbItems} -
- ); -}); - describe('react router', () => { beforeAll(() => { jest.useFakeTimers(); @@ -62,7 +31,37 @@ describe('react router', () => { jest.useRealTimers(); }); // https://github.com/airbnb/enzyme/issues/875 - it('react router 4', () => { + (process.env.REACT === '15' ? it.skip : it)('react router 4', () => { + const Home = withRouter(props => { + const { location, history } = props; + const pathSnippets = location.pathname.split('/').filter(i => i); + const extraBreadcrumbItems = pathSnippets.map((_, index) => { + const url = `/${pathSnippets.slice(0, index + 1).join('/')}`; + return ( + + {breadcrumbNameMap[url]} + + ); + }); + const breadcrumbItems = [ + + Home + , + ].concat(extraBreadcrumbItems); + return ( +
+
+ history.push('/')}>Home + history.push('/apps')}>Application List +
+ + + Home Page} /> + + {breadcrumbItems} +
+ ); + }); const wrapper = mount(