rsnext/test/integration/client-navigation/pages/nav/with-hoc.js
JJ Kasper 7d0919a784 Break up basic test suite (#6730)
* Break out client-navigation and rendering
test from basic test

* Try with parallelism dialed back to 3

* Update jest-junit for more compatible timings in CircleCI

* Bump to test timings

* Use filepath for suitename in jest-junit

* Store reports as artifacts

* Try using classname for timings

* Bump

* Remove reports from artifacts
2019-03-20 11:01:32 +01:00

23 lines
543 B
JavaScript

import { withRouter } from 'next/router'
const Link = withRouter(({ router, children, href }) => {
const handleClick = (e) => {
e.preventDefault()
router.push(href)
}
return (
<div>
<span id='pathname'>Current path: {router.pathname}</span>
<span id='asPath'>Current asPath: {router.asPath}</span>
<a href='#' onClick={handleClick}>{children}</a>
</div>
)
})
export default () => (
<div className='nav-with-hoc'>
<Link href='/nav'>Go Back</Link>
<p>This is the about page.</p>
</div>
)