Skip to content

Commit

Permalink
test: add reproduction for #8429
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 2, 2020
1 parent e9f380c commit 915bac5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/dev/encoding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ describe('encoding', () => {
expect(response).toContain('Unicode base works!')
})

test('/ö/query?q=food,coffee (encodeURIComponent)', async () => {
const { body: response } = await rp(url('/ö/query?q=food%252Ccoffee'))

expect(response).toContain('food,coffee')
})

// Close server and ask nuxt to stop listening to file changes
afterAll(async () => {
await nuxt.close()
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/encoding/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<NLink :to="encodeURI('/тест?spa')">
/тест (SPA encoded)
</NLink>
<br>
<NLink to="/query?q=food%2Ccoffee">
/query?q=food%2Ccoffee
</NLink>
</div>
<Nuxt />
</div>
Expand Down
15 changes: 15 additions & 0 deletions test/fixtures/encoding/pages/query.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<div>
<p>Query (SSR): <pre v-text="q" /></p>
</div>
</template>

<script>
export default {
asyncData ({ route }) {
return {
q: route.query
}
}
}
</script>

1 comment on commit 915bac5

@ydnar
Copy link

@ydnar ydnar commented on 915bac5 Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Please sign in to comment.