Skip to content

Commit

Permalink
test: add comma cases
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Oct 7, 2024
1 parent 2c999c5 commit fb877ad
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions tests/e2e/on-demand-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ test.describe('app router on-demand revalidation', () => {
{
label: 'revalidatePath (prerendered page with dynamic path) - non-ASCII variant',
prerendered: true,
pagePath: '/product/事前レンダリング',
revalidateApiPath: `/api/on-demand-revalidate/path?path=/product/事前レンダリング`,
expectedH1Content: 'Product 事前レンダリング',
pagePath: '/product/事前レンダリング,test',
revalidateApiPath: `/api/on-demand-revalidate/path?path=/product/事前レンダリング,test`,
expectedH1Content: 'Product 事前レンダリング,test',
},
{
label: 'revalidatePath (not prerendered page with dynamic path) - non-ASCII variant',
prerendered: false,
pagePath: '/product/事前レンダリングされていない',
revalidateApiPath: `/api/on-demand-revalidate/path?path=/product/事前レンダリングされていない`,
expectedH1Content: 'Product 事前レンダリングされていない',
pagePath: '/product/事前レンダリングされていない,test',
revalidateApiPath: `/api/on-demand-revalidate/path?path=/product/事前レンダリングされていない,test`,
expectedH1Content: 'Product 事前レンダリングされていない,test',
},
]) {
test(label, async ({ page, pollUntilHeadersMatch, serverComponents }) => {
Expand Down
16 changes: 8 additions & 8 deletions tests/e2e/page-router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ test.describe('Simple Page Router (no basePath, no i18n)', () => {
label:
'prerendered page with dynamic path and awaited res.revalidate() - non-ASCII variant',
prerendered: true,
pagePath: '/products/事前レンダリング',
pagePath: '/products/事前レンダリング,test',
revalidateApiBasePath: '/api/revalidate',
expectedH1Content: 'Product 事前レンダリング',
expectedH1Content: 'Product 事前レンダリング,test',
},
{
label:
'not prerendered page with dynamic path and awaited res.revalidate() - non-ASCII variant',
prerendered: false,
pagePath: '/products/事前レンダリングされていない',
pagePath: '/products/事前レンダリングされていない,test',
revalidateApiBasePath: '/api/revalidate',
expectedH1Content: 'Product 事前レンダリングされていない',
expectedH1Content: 'Product 事前レンダリングされていない,test',
},
]) {
test(label, async ({ page, pollUntilHeadersMatch, pageRouter }) => {
Expand Down Expand Up @@ -479,17 +479,17 @@ test.describe('Page Router with basePath and i18n', () => {
label:
'prerendered page with dynamic path and awaited res.revalidate() - non-ASCII variant',
prerendered: true,
pagePath: '/products/事前レンダリング',
pagePath: '/products/事前レンダリング,test',
revalidateApiBasePath: '/api/revalidate',
expectedH1Content: 'Product 事前レンダリング',
expectedH1Content: 'Product 事前レンダリング,test',
},
{
label:
'not prerendered page with dynamic path and awaited res.revalidate() - non-ASCII variant',
prerendered: false,
pagePath: '/products/事前レンダリングされていない',
pagePath: '/products/事前レンダリングされていない,test',
revalidateApiBasePath: '/api/revalidate',
expectedH1Content: 'Product 事前レンダリングされていない',
expectedH1Content: 'Product 事前レンダリングされていない,test',
},
]) {
test.describe(label, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const getStaticPaths = ({ locales }) => {
},
{
params: {
// Japanese prerendered (non-ascii)
slug: '事前レンダリング',
// Japanese prerendered (non-ascii) and comma
slug: '事前レンダリング,test',
},
},
].flatMap((pathDescription) => locales.map((locale) => ({ ...pathDescription, locale }))),
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/page-router/pages/products/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const getStaticPaths = () => {
},
{
params: {
// Japanese prerendered (non-ascii)
slug: '事前レンダリング',
// Japanese prerendered (non-ascii) and comma
slug: '事前レンダリング,test',
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/server-components/app/product/[slug]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const Product = ({ params }) => (
export async function generateStaticParams() {
return [
{
// Japanese prerendered (non-ascii)
slug: '事前レンダリング',
// Japanese prerendered (non-ascii) and comma
slug: '事前レンダリング,test',
},
]
}
Expand Down

0 comments on commit fb877ad

Please sign in to comment.