Skip to content

Commit

Permalink
fix test for navigation changing query
Browse files Browse the repository at this point in the history
  • Loading branch information
jankaifer committed Dec 12, 2022
1 parent ae1aca2 commit bfd9f83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/e2e/app-dir/navigation-and-querystring/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function Page() {
<Link id="set-query" href="/?a=b&c=d">
set Query
</Link>
<div id="query">{JSON.stringify(params)}</div>
<div id="query">{params.toString()}</div>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ describe('app-dir navigation and querystring', () => {
it('shoul set query correctly', async () => {
const browser = await webdriver(next.url, '/')
expect(await browser.elementById('query').text()).toMatchInlineSnapshot(
`"{}"`
`""`
)

browser.elementById('set-query').click()
await waitFor(200)

expect(await browser.elementById('query').text()).toMatchInlineSnapshot()
expect(await browser.elementById('query').text()).toMatchInlineSnapshot(
`"a=b&c=d"`
)
const url = new URL(await browser.url())
expect(url.searchParams.toString()).toMatchInlineSnapshot(`"a=b&c=d"`)
})
})

0 comments on commit bfd9f83

Please sign in to comment.