From 8d2ed278dc11ffb6121d27789b36409de6b9c529 Mon Sep 17 00:00:00 2001 From: Tyler <26290074+thegitduck@users.noreply.github.com> Date: Mon, 18 Nov 2024 07:10:31 -0500 Subject: [PATCH] save testing --- e2e/use-router.spec.ts | 16 ++++++++++++---- packages/waku/src/router/client.ts | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/e2e/use-router.spec.ts b/e2e/use-router.spec.ts index 04c2df9d1..f73541ee5 100644 --- a/e2e/use-router.spec.ts +++ b/e2e/use-router.spec.ts @@ -123,18 +123,26 @@ test.describe('useRouter', async () => { test(`on dynamic pages`, async ({ page }) => { const [port, pid] = await start(); await page.goto(`http://localhost:${port}/dynamic`); - await page.click('text=Increment query'); + const incrementLink = page.getByRole('link', { name: 'Increment query' }); + await incrementLink.click(); await expect(page.getByTestId('query')).toHaveText('Query: 1'); - await page.click('text=Increment query (push)'); + const incrementButton = page.getByRole('button', { + name: 'Increment query (push)', + }); + await incrementButton.click(); await expect(page.getByTestId('query')).toHaveText('Query: 2'); await terminate(pid!); }); test(`on static pages`, async ({ page }) => { const [port, pid] = await start(); await page.goto(`http://localhost:${port}/static`); - await page.click('text=Increment query'); + const incrementLink = page.getByRole('link', { name: 'Increment query' }); + await incrementLink.click(); await expect(page.getByTestId('query')).toHaveText('Query: 1'); - await page.click('text=Increment query (push)'); + const incrementButton = page.getByRole('button', { + name: 'Increment query (push)', + }); + await incrementButton.click(); await expect(page.getByTestId('query')).toHaveText('Query: 2'); await terminate(pid!); }); diff --git a/packages/waku/src/router/client.ts b/packages/waku/src/router/client.ts index 5f6a154eb..50777870d 100644 --- a/packages/waku/src/router/client.ts +++ b/packages/waku/src/router/client.ts @@ -507,7 +507,7 @@ const InnerRouter = ({ routerData }: { routerData: RouterData }) => { // Note: The router data must be a stable mutable object (array). type RouterData = [ shouldSkip?: ShouldSkip, - locationListners?: Set<(path: string, query: string) => void>, + locationListeners?: Set<(path: string, query: string) => void>, has404?: boolean, ];