Skip to content

Commit

Permalink
test only latest react router dom
Browse files Browse the repository at this point in the history
  • Loading branch information
vzaidman committed Dec 28, 2024
1 parent 45fcdcf commit cd969a0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/librariesTests/react-router-dom.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { legacy_createStore as createStore } from 'redux';
import {
BrowserRouter as Router6,
useLocation as useLocation6,
Routes as Routes6,
Route as Route6,
BrowserRouter,
useLocation,
Routes,
Route,
} from 'react-router-dom';
import { connect, Provider } from 'react-redux';
import { cloneDeep } from 'lodash';
Expand All @@ -29,7 +29,7 @@ afterEach(() => {
describe('react-router-dom', () => {
test('simple', () => {
const InnerComp = () => {
const location = useLocation6();
const location = useLocation();

// eslint-disable-next-line no-console
console.log(`location is: ${location.pathname}`);
Expand All @@ -42,11 +42,11 @@ describe('react-router-dom', () => {
InnerComp.whyDidYouRender = true;

const Comp = () => (
<Router6>
<Routes6>
<Route6 exact path="/" element={<InnerComp a={[]}/>}/>
</Routes6>
</Router6>
<BrowserRouter>
<Routes>
<Route exact path="/" element={<InnerComp a={[]}/>}/>
</Routes>
</BrowserRouter>
);

const { rerender } = rtl.render(<Comp/>);
Expand Down Expand Up @@ -98,7 +98,7 @@ describe('react-router-dom', () => {
const store = createStore(rootReducer, initialState);

const InnerFn = ({ a, setDeepEqlState }) => {
const location = useLocation6();
const location = useLocation();

// eslint-disable-next-line no-console
console.log(`location is: ${location.pathname}`);
Expand All @@ -121,11 +121,11 @@ describe('react-router-dom', () => {

const Comp = () => (
<Provider store={store}>
<Router6>
<Routes6>
<Route6 exact path="/" element={<InnerComp/>}/>
</Routes6>
</Router6>
<BrowserRouter>
<Routes>
<Route exact path="/" element={<InnerComp/>}/>
</Routes>
</BrowserRouter>
</Provider>
);

Expand Down

0 comments on commit cd969a0

Please sign in to comment.