-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add client-side navigation tests in middleware features
- Loading branch information
1 parent
4448fcf
commit 9dbefa1
Showing
8 changed files
with
176 additions
and
39 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
27 changes: 27 additions & 0 deletions
27
pages-e2e/features/appMiddleware/assets/app/middleware-test/pageB/page.jsx
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,27 @@ | ||
import Link from 'next/link'; | ||
|
||
export default function Page() { | ||
const links = [ | ||
{ | ||
href: '/middleware-test/pageC?redirect-to-page-a', | ||
text: 'go to page A via middleware redirect', | ||
}, | ||
{ | ||
href: '/middleware-test/pageC?rewrite-to-page-a', | ||
text: 'go to page C which is page A served via middleware rewrite', | ||
}, | ||
]; | ||
|
||
return ( | ||
<div> | ||
<h1>Page B</h1> | ||
{links.map(({ href, text }) => ( | ||
<div key={href}> | ||
<Link href={href}>{text}</Link> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export const runtime = 'edge'; |
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
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
27 changes: 27 additions & 0 deletions
27
pages-e2e/features/pagesMiddleware/assets/pages/middleware-test/pageB.jsx
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,27 @@ | ||
import Link from 'next/link'; | ||
|
||
export const config = { runtime: 'experimental-edge' }; | ||
|
||
export default function Page() { | ||
const links = [ | ||
{ | ||
href: '/middleware-test/pageC?redirect-to-page-a', | ||
text: 'go to page A via middleware redirect', | ||
}, | ||
{ | ||
href: '/middleware-test/pageC?rewrite-to-page-a', | ||
text: 'go to page C which is page A served via middleware rewrite', | ||
}, | ||
]; | ||
|
||
return ( | ||
<div> | ||
<h1>Page B</h1> | ||
{links.map(({ href, text }) => ( | ||
<div key={href}> | ||
<Link href={href}>{text}</Link> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} |
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