diff --git a/tests/e2e/page-router.test.ts b/tests/e2e/page-router.test.ts index 8715145e3e..d0c8f2ee11 100644 --- a/tests/e2e/page-router.test.ts +++ b/tests/e2e/page-router.test.ts @@ -1352,13 +1352,15 @@ test.describe('Page Router with basePath and i18n', () => { test('requesting a non existing page route that needs to be fetched from the blob store like 404.html', async ({ page, - pageRouter, + pageRouterBasePathI18n, }) => { - const response = await page.goto(new URL('non-existing', pageRouter.url).href) + const response = await page.goto( + new URL('base/path/non-existing', pageRouterBasePathI18n.url).href, + ) const headers = response?.headers() || {} expect(response?.status()).toBe(404) - expect(await page.textContent('p')).toBe('Custom 404 page') + expect(await page.textContent('p')).toBe('Custom 404 page for locale: en') expect(headers['debug-netlify-cdn-cache-control']).toMatch( /no-cache, no-store, max-age=0, must-revalidate, durable/m, @@ -1368,13 +1370,15 @@ test.describe('Page Router with basePath and i18n', () => { test('requesting a non existing page route that needs to be fetched from the blob store like 404.html (notFound: true)', async ({ page, - pageRouter, + pageRouterBasePathI18n, }) => { - const response = await page.goto(new URL('static/not-found', pageRouter.url).href) + const response = await page.goto( + new URL('base/path/static/not-found', pageRouterBasePathI18n.url).href, + ) const headers = response?.headers() || {} expect(response?.status()).toBe(404) - expect(await page.textContent('p')).toBe('Custom 404 page') + expect(await page.textContent('p')).toBe('Custom 404 page for locale: en') // Prior to v14.2.4 notFound pages are not cacheable // https://github.com/vercel/next.js/pull/66674 diff --git a/tests/utils/playwright-helpers.ts b/tests/utils/playwright-helpers.ts index 3c05b0c6b2..8a6bd1f912 100644 --- a/tests/utils/playwright-helpers.ts +++ b/tests/utils/playwright-helpers.ts @@ -98,7 +98,7 @@ export const test = base.extend< if (response.url().includes('/_next/static/')) { expect( response.headers()['cache-control'], - '_next/static assets should have immutable cache control', + `_next/static asset (${response.url()}) should have immutable cache control`, ).toContain('public,max-age=31536000,immutable') } })