mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
There's apparently some interference with other tests when running the `withRouter` integration test in the CI, which leads to [frequent test failures](https://app.datadoghq.com/ci/test-runs?query=test_level%3Atest%20env%3Aci%20%40git.repository.id%3Agithub.com%2Fvercel%2Fnext.js%20%40test.service%3Anextjs%20%40test.suite%3A%2AwithRouter%2A%20%40test.status%3Afail&agg_m=count&agg_m_source=base&agg_t=count¤tTab=overview&eventStack=&fromUser=false&index=citest&start=1713009743249&end=1720785743249&paused=true). In lieu of identifying the interference source, we can refactor the test to an e2e test. This should also fix the flakiness. closes [NDX-64](https://linear.app/vercel/issue/NDX-64/investigate-flakiness-of-testintegrationwith-router) closes #67706
19 lines
332 B
JavaScript
19 lines
332 B
JavaScript
import * as React from 'react'
|
|
import { withRouter } from 'next/router'
|
|
|
|
class PageA extends React.Component {
|
|
goToB() {
|
|
this.props.router.push('/b')
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div id="page-a">
|
|
<button onClick={() => this.goToB()}>Go to B</button>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default withRouter(PageA)
|