未验证 提交 e56a6add 编写于 作者: J Jan Potoms 提交者: GitHub

Add test for query param bug #15233 (#15238)

Fixes https://github.com/vercel/next.js/issues/15233
上级 bd9fc12f
......@@ -30,6 +30,10 @@ const Home = () => (
>
<a id="single-colon">Single: :</a>
</Link>
<br />
<Link href="/query?id=http://example.com/">
<a id="url-param">Url query param</a>
</Link>
</div>
)
......
export function getServerSideProps({ query }) {
return { props: query }
}
export default function Single(props) {
return <pre id="query-content">{JSON.stringify(props)}</pre>
}
......@@ -295,5 +295,19 @@ describe('Link Component with Encoding', () => {
await browser.close()
}
})
it('should have correct parsing of url query params', async () => {
const browser = await webdriver(appPort, '/')
try {
await browser.waitForElementByCss('#url-param').click()
const content = await browser
.waitForElementByCss('#query-content')
.text()
const query = JSON.parse(content)
expect(query).toHaveProperty('id', 'http://example.com/')
} finally {
await browser.close()
}
})
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册