Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for i18n + developments page
- Loading branch information
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
test/integration/i18n-support-base-path/pages/developments/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,33 @@ | ||
import Link from 'next/link' | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Page(props) { | ||
const router = useRouter() | ||
|
||
return ( | ||
<> | ||
<p id="developments">developments page</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
<p id="router-locale">{router.locale}</p> | ||
<p id="router-default-locale">{router.defaultLocale}</p> | ||
<p id="router-locales">{JSON.stringify(router.locales)}</p> | ||
<p id="router-query">{JSON.stringify(router.query)}</p> | ||
<p id="router-pathname">{router.pathname}</p> | ||
<p id="router-as-path">{router.asPath}</p> | ||
<Link href="/"> | ||
<a id="to-index">to /</a> | ||
</Link> | ||
<br /> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = ({ locale, locales, defaultLocale }) => { | ||
return { | ||
props: { | ||
locale, | ||
locales, | ||
defaultLocale, | ||
}, | ||
} | ||
} |
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,33 @@ | ||
import Link from 'next/link' | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Page(props) { | ||
const router = useRouter() | ||
|
||
return ( | ||
<> | ||
<p id="developments">developments page</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
<p id="router-locale">{router.locale}</p> | ||
<p id="router-default-locale">{router.defaultLocale}</p> | ||
<p id="router-locales">{JSON.stringify(router.locales)}</p> | ||
<p id="router-query">{JSON.stringify(router.query)}</p> | ||
<p id="router-pathname">{router.pathname}</p> | ||
<p id="router-as-path">{router.asPath}</p> | ||
<Link href="/"> | ||
<a id="to-index">to /</a> | ||
</Link> | ||
<br /> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = ({ locale, locales, defaultLocale }) => { | ||
return { | ||
props: { | ||
locale, | ||
locales, | ||
defaultLocale, | ||
}, | ||
} | ||
} |
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