From 5f1de9f0147434b03fbda14fd19d97ebc9439644 Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Wed, 9 Oct 2024 18:13:20 +0800 Subject: [PATCH] chore: add test for #12763 (#12774) --- .../src/routes/load/server-log-search-param/+page.server.js | 3 +++ .../src/routes/load/server-log-search-param/+page.svelte | 1 + packages/kit/test/apps/basics/test/server.test.js | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.server.js create mode 100644 packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.svelte diff --git a/packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.server.js b/packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.server.js new file mode 100644 index 000000000000..d5733a0bde6f --- /dev/null +++ b/packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.server.js @@ -0,0 +1,3 @@ +export function load({ url }) { + console.log(url.searchParams); +} diff --git a/packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.svelte b/packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.svelte new file mode 100644 index 000000000000..48aa4cb69f99 --- /dev/null +++ b/packages/kit/test/apps/basics/src/routes/load/server-log-search-param/+page.svelte @@ -0,0 +1 @@ +

hello world

diff --git a/packages/kit/test/apps/basics/test/server.test.js b/packages/kit/test/apps/basics/test/server.test.js index 58a8c4cb0033..3c8803a588f1 100644 --- a/packages/kit/test/apps/basics/test/server.test.js +++ b/packages/kit/test/apps/basics/test/server.test.js @@ -484,6 +484,12 @@ test.describe('Load', () => { expect(await response.text()).toBe(''); expect(response.headers()['allow']).toBe('GET, HEAD, OPTIONS, POST'); }); + + test('allows logging URL search params', async ({ page }) => { + await page.goto('/load/server-log-search-param'); + + expect(await page.textContent('p')).toBe('hello world'); + }); }); test.describe('Routing', () => {