Skip to content

Commit

Permalink
test: add test case for vuejs#2938
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Sep 23, 2019
1 parent 9fe3cef commit e0dcda8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/route-params/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import VueRouter from 'vue-router'
Vue.use(VueRouter)

const Log = {
template: `<div class="log">id: {{$route.params.id}}, type: {{$route.params.type}}</div>`
template: `<div class="log">id: {{ $route.params.id }}, type: {{ $route.params.type }}</div>`
}

const Logs = {
template: `
<div>
<router-link :to="to" class="child-link">{{to.params.type}}</router-link>
<pre id="params">{{ to.params }}</pre>
<router-link :to="to" class="child-link">{{ to.params.type }}</router-link>
<router-view></router-view>
</div>
`,
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/specs/route-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ module.exports = {
// https://github.com/vuejs/vue-router/issues/2800
.click('li:nth-child(1) a')
.assert.urlEquals('http://localhost:8080/route-params/items/1/logs')
.assert.containsText('#params', JSON.stringify({ type: 'info' }, null, 2))
.click('.child-link')
.assert.urlEquals('http://localhost:8080/route-params/items/1/logs/info')
.assert.containsText('.log', 'id: 1, type: info')
// https://github.com/vuejs/vue-router/issues/2938
.assert.containsText('#params', JSON.stringify({ type: 'info' }, null, 2))

.click('li:nth-child(2) a')
.assert.urlEquals('http://localhost:8080/route-params/items/2/logs')
Expand Down

0 comments on commit e0dcda8

Please sign in to comment.