-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for legacy NextCustomServer methods
- Loading branch information
1 parent
e18312c
commit 815e3dc
Showing
7 changed files
with
178 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => <p>made it to 404</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => <p>made it to 500</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
export default () => <p>made it to dashboard</p> | ||
import { useRouter } from 'next/router' | ||
|
||
export default () => { | ||
const router = useRouter() | ||
const searchParam = router.query.q | ||
return ( | ||
<p> | ||
made it to dashboard | ||
{!!searchParam && ( | ||
<> | ||
<br /> | ||
query param: {searchParam} | ||
</> | ||
)} | ||
</p> | ||
) | ||
} |
22 changes: 22 additions & 0 deletions
22
test/integration/custom-server/pages/dynamic-dashboard/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
// NOTE: we want this page to be dynamic, otherwise the HTML won't contain search params | ||
export async function getServerSideProps() { | ||
return { props: {} } | ||
} | ||
|
||
export default function Page() { | ||
const router = useRouter() | ||
const searchParam = router.query.q | ||
return ( | ||
<p> | ||
made it to dynamic dashboard | ||
{!!searchParam && ( | ||
<> | ||
<br /> | ||
query param: {searchParam} | ||
</> | ||
)} | ||
</p> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters