mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Same basic idea as https://github.com/vercel/next.js/pull/78787 This test suite has a lot of timeouts with rspack, which causes it to take a long time to run (though not quite long enough that it breaks the job). In general, large test suites are good to break up, because they benefit from parallelism.
76 lines
1.9 KiB
JavaScript
76 lines
1.9 KiB
JavaScript
import Link from 'next/link'
|
|
import { useRouter } from 'next/router'
|
|
|
|
function Page() {
|
|
const router = useRouter()
|
|
const routerObj = router.isReady ? router : { pathname: '', asPath: '' }
|
|
return (
|
|
<>
|
|
<Link href="/other-page" id="other-page-link">
|
|
<h1>Hello World</h1>
|
|
</Link>
|
|
<br />
|
|
<Link href="/gsp" id="gsp-link">
|
|
<h1>getStaticProps</h1>
|
|
</Link>
|
|
<br />
|
|
<Link href="/gssp" id="gssp-link">
|
|
<h1>getServerSideProps</h1>
|
|
</Link>
|
|
<br />
|
|
<Link href="/[slug]" as="/first" id="dynamic-link">
|
|
<h1>dynamic page</h1>
|
|
</Link>
|
|
<br />
|
|
<Link
|
|
href="/catchall/[...parts]"
|
|
as="/catchall/hello/world"
|
|
id="catchall-link"
|
|
>
|
|
<h1>catchall page</h1>
|
|
</Link>
|
|
<br />
|
|
<Link href="/" id="index-gsp">
|
|
<h1>index getStaticProps</h1>
|
|
</Link>
|
|
<br />
|
|
<Link href="/index" id="nested-index-gsp">
|
|
<h1>nested index getStaticProps</h1>
|
|
</Link>
|
|
<Link href="#hashlink" id="hashlink">
|
|
Hash Link
|
|
</Link>
|
|
<br />
|
|
<div id="base-path">{router.basePath}</div>
|
|
<div id="pathname" suppressHydrationWarning>
|
|
{routerObj.pathname}
|
|
</div>
|
|
<div
|
|
id="trigger-error"
|
|
onClick={() => {
|
|
throw new Error('oops heres an error')
|
|
}}
|
|
>
|
|
click me for error
|
|
</div>
|
|
<br />
|
|
<div id="as-path" suppressHydrationWarning>
|
|
{routerObj.asPath}
|
|
</div>
|
|
<Link href="/slow-route" id="slow-route">
|
|
<h1>Slow route</h1>
|
|
</Link>
|
|
<Link href="/error-route" id="error-route">
|
|
<h1>Error route</h1>
|
|
</Link>
|
|
<Link href="/hello#some-hash" id="hash-change">
|
|
<h1>Hash change</h1>
|
|
</Link>
|
|
<Link href="/something-else" as="/hello" id="something-else-link">
|
|
to something else
|
|
</Link>
|
|
</>
|
|
)
|
|
}
|
|
export default Page
|