Commit 40137434 authored by Sam Chen's avatar Sam Chen Committed by GitHub

chore: upgrades react-router-dom, fixes dev-mode linking (#4115)

* fix: stale route

* fix: add e2e test

* fix: update e2e test
parent e9ef3193
// see https://github.com/Uniswap/interface/pull/4115
describe('Link', () => {
it('should update route', () => {
cy.visit('/')
cy.get('[data-cy="pool-nav-link"]').click()
cy.get('[data-cy="join-pool-button"]').should('exist')
})
})
...@@ -281,6 +281,7 @@ export default function Header() { ...@@ -281,6 +281,7 @@ export default function Header() {
<Trans>Swap</Trans> <Trans>Swap</Trans>
</StyledNavLink> </StyledNavLink>
<StyledNavLink <StyledNavLink
data-cy="pool-nav-link"
id={`pool-nav-link`} id={`pool-nav-link`}
to={'/pool'} to={'/pool'}
isActive={(match, { pathname }) => isActive={(match, { pathname }) =>
......
...@@ -588,7 +588,11 @@ export function PositionPage({ ...@@ -588,7 +588,11 @@ export function PositionPage({
/> />
<AutoColumn gap="md"> <AutoColumn gap="md">
<AutoColumn gap="sm"> <AutoColumn gap="sm">
<Link style={{ textDecoration: 'none', width: 'fit-content', marginBottom: '0.5rem' }} to="/pool"> <Link
data-cy="visit-pool"
style={{ textDecoration: 'none', width: 'fit-content', marginBottom: '0.5rem' }}
to="/pool"
>
<HoverText> <HoverText>
<Trans>← Back to Pools Overview</Trans> <Trans>← Back to Pools Overview</Trans>
</HoverText> </HoverText>
......
...@@ -279,7 +279,7 @@ export default function Pool() { ...@@ -279,7 +279,7 @@ export default function Pool() {
)} )}
/> />
)} )}
<ResponsiveButtonPrimary id="join-pool-button" as={Link} to="/add/ETH"> <ResponsiveButtonPrimary data-cy="join-pool-button" id="join-pool-button" as={Link} to="/add/ETH">
+ <Trans>New Position</Trans> + <Trans>New Position</Trans>
</ResponsiveButtonPrimary> </ResponsiveButtonPrimary>
</ButtonRow> </ButtonRow>
......
...@@ -15129,25 +15129,25 @@ react-remove-scroll@^2.3.0: ...@@ -15129,25 +15129,25 @@ react-remove-scroll@^2.3.0:
use-callback-ref "^1.2.3" use-callback-ref "^1.2.3"
use-sidecar "^1.0.1" use-sidecar "^1.0.1"
react-router-dom@^5.0.0: react-router-dom@^5.3.3:
version "5.2.0" version "5.3.3"
resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz" resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.3.3.tgz#8779fc28e6691d07afcaf98406d3812fe6f11199"
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA== integrity sha512-Ov0tGPMBgqmbu5CDmN++tv2HQ9HlWDuWIIqn4b88gjlAN5IHI+4ZUZRcpz9Hl0azFIwihbLDYw1OiHGRo7ZIng==
dependencies: dependencies:
"@babel/runtime" "^7.1.2" "@babel/runtime" "^7.12.13"
history "^4.9.0" history "^4.9.0"
loose-envify "^1.3.1" loose-envify "^1.3.1"
prop-types "^15.6.2" prop-types "^15.6.2"
react-router "5.2.0" react-router "5.3.3"
tiny-invariant "^1.0.2" tiny-invariant "^1.0.2"
tiny-warning "^1.0.0" tiny-warning "^1.0.0"
react-router@5.2.0: react-router@5.3.3:
version "5.2.0" version "5.3.3"
resolved "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz" resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.3.3.tgz#8e3841f4089e728cf82a429d92cdcaa5e4a3a288"
integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw== integrity sha512-mzQGUvS3bM84TnbtMYR8ZjKnuPJ71IjSzR+DE6UkUqvN4czWIqEs17yLL8xkAycv4ev0AiN+IGrWu88vJs/p2w==
dependencies: dependencies:
"@babel/runtime" "^7.1.2" "@babel/runtime" "^7.12.13"
history "^4.9.0" history "^4.9.0"
hoist-non-react-statics "^3.1.0" hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1" loose-envify "^1.3.1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment