diff --git a/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/+layout.svelte b/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/+layout.svelte index 892a448060916..332e638ff7f0a 100644 --- a/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/+layout.svelte +++ b/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/+layout.svelte @@ -3,8 +3,11 @@ export let data; + diff --git a/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/ignore/+page.server.js b/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/ignore/+page.server.js new file mode 100644 index 0000000000000..42a828c116a31 --- /dev/null +++ b/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/ignore/+page.server.js @@ -0,0 +1 @@ +export const trailingSlash = 'ignore'; diff --git a/packages/kit/test/apps/basics/test/cross-platform/test.js b/packages/kit/test/apps/basics/test/cross-platform/test.js index 170e3f5bd32ab..e5cf35c64bda7 100644 --- a/packages/kit/test/apps/basics/test/cross-platform/test.js +++ b/packages/kit/test/apps/basics/test/cross-platform/test.js @@ -936,6 +936,29 @@ test.describe('Routing', () => { ); }); + test('trailing slash server with config ignore and no trailing slash in URL', async ({ page, clicknav }) => { + await page.goto('/routing/trailing-slash-server'); + await clicknav('[href="/routing/trailing-slash-server/ignore"]'); + expect(await page.textContent('[data-test-id="pathname-store"]')).toBe( + '/routing/trailing-slash-server/ignore' + ); + expect(await page.textContent('[data-test-id="pathname-data"]')).toBe( + '/routing/trailing-slash-server/ignore' + ); + }); + + test('trailing slash server with config ignore and trailing slash in URL', async ({ page, clicknav }) => { + await page.goto('/routing/trailing-slash-server'); + await clicknav('[href="/routing/trailing-slash-server/ignore/"]'); + expect(await page.textContent('[data-test-id="pathname-store"]')).toBe( + '/routing/trailing-slash-server/ignore/' + ); + expect(await page.textContent('[data-test-id="pathname-data"]')).toBe( + '/routing/trailing-slash-server/ignore/' + ); + + }); + test('trailing slash server with config never', async ({ page, clicknav }) => { await page.goto('/routing/trailing-slash-server'); await clicknav('[href="/routing/trailing-slash-server/never/"]');