From 758b8f188975364e54537cc07a110019abe55e5d Mon Sep 17 00:00:00 2001 From: pieh Date: Mon, 7 Oct 2024 13:22:53 +0200 Subject: [PATCH] test: add comma cases --- tests/e2e/on-demand-app.test.ts | 12 ++++++------ tests/e2e/page-router.test.ts | 16 ++++++++-------- .../pages/products/[slug].js | 4 ++-- .../page-router/pages/products/[slug].js | 4 ++-- .../server-components/app/product/[slug]/page.js | 4 ++-- tests/integration/cache-handler.test.ts | 4 ++-- tests/integration/static.test.ts | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/e2e/on-demand-app.test.ts b/tests/e2e/on-demand-app.test.ts index ab52a0f722..a87d9cc265 100644 --- a/tests/e2e/on-demand-app.test.ts +++ b/tests/e2e/on-demand-app.test.ts @@ -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 }) => { diff --git a/tests/e2e/page-router.test.ts b/tests/e2e/page-router.test.ts index ec8637c747..2124ba53c7 100644 --- a/tests/e2e/page-router.test.ts +++ b/tests/e2e/page-router.test.ts @@ -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 }) => { @@ -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, () => { diff --git a/tests/fixtures/page-router-base-path-i18n/pages/products/[slug].js b/tests/fixtures/page-router-base-path-i18n/pages/products/[slug].js index cbcf6908e3..f41d142c67 100644 --- a/tests/fixtures/page-router-base-path-i18n/pages/products/[slug].js +++ b/tests/fixtures/page-router-base-path-i18n/pages/products/[slug].js @@ -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 }))), diff --git a/tests/fixtures/page-router/pages/products/[slug].js b/tests/fixtures/page-router/pages/products/[slug].js index df379c7001..a55c3d0991 100644 --- a/tests/fixtures/page-router/pages/products/[slug].js +++ b/tests/fixtures/page-router/pages/products/[slug].js @@ -32,8 +32,8 @@ export const getStaticPaths = () => { }, { params: { - // Japanese prerendered (non-ascii) - slug: '事前レンダリング', + // Japanese prerendered (non-ascii) and comma + slug: '事前レンダリング,test', }, }, ], diff --git a/tests/fixtures/server-components/app/product/[slug]/page.js b/tests/fixtures/server-components/app/product/[slug]/page.js index f79039807b..3f6df1ce41 100644 --- a/tests/fixtures/server-components/app/product/[slug]/page.js +++ b/tests/fixtures/server-components/app/product/[slug]/page.js @@ -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', }, ] } diff --git a/tests/integration/cache-handler.test.ts b/tests/integration/cache-handler.test.ts index 9928849812..c7536504db 100644 --- a/tests/integration/cache-handler.test.ts +++ b/tests/integration/cache-handler.test.ts @@ -46,7 +46,7 @@ describe('page router', () => { // the real key is much longer and ends in a hash, but we only assert on the first 50 chars to make it easier '/products/an-incredibly-long-product-', '/products/prerendered', - '/products/事前レンダリング', + '/products/事前レンダリング,test', '/static/revalidate-automatic', '/static/revalidate-manual', '/static/revalidate-slow', @@ -360,7 +360,7 @@ describe('plugin', () => { '/api/static/first', '/api/static/second', '/index', - '/product/事前レンダリング', + '/product/事前レンダリング,test', '/revalidate-fetch', '/static-fetch-1', '/static-fetch-2', diff --git a/tests/integration/static.test.ts b/tests/integration/static.test.ts index 911d2d0968..3e167a291e 100644 --- a/tests/integration/static.test.ts +++ b/tests/integration/static.test.ts @@ -37,7 +37,7 @@ test('requesting a non existing page route that needs to be expect(entries.map(({ key }) => decodeBlobKey(key.substring(0, 50))).sort()).toEqual([ '/products/an-incredibly-long-product-', '/products/prerendered', - '/products/事前レンダリング', + '/products/事前レンダリング,test', '/static/revalidate-automatic', '/static/revalidate-manual', '/static/revalidate-slow',