Skip to content

Commit e0dcda8

Browse files
committed
test: add test case for vuejs#2938
1 parent 9fe3cef commit e0dcda8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: examples/route-params/app.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import VueRouter from 'vue-router'
44
Vue.use(VueRouter)
55

66
const Log = {
7-
template: `<div class="log">id: {{$route.params.id}}, type: {{$route.params.type}}</div>`
7+
template: `<div class="log">id: {{ $route.params.id }}, type: {{ $route.params.type }}</div>`
88
}
99

1010
const Logs = {
1111
template: `
1212
<div>
13-
<router-link :to="to" class="child-link">{{to.params.type}}</router-link>
13+
<pre id="params">{{ to.params }}</pre>
14+
<router-link :to="to" class="child-link">{{ to.params.type }}</router-link>
1415
<router-view></router-view>
1516
</div>
1617
`,

Diff for: test/e2e/specs/route-params.js

+3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ module.exports = {
88
// https://github.com/vuejs/vue-router/issues/2800
99
.click('li:nth-child(1) a')
1010
.assert.urlEquals('http://localhost:8080/route-params/items/1/logs')
11+
.assert.containsText('#params', JSON.stringify({ type: 'info' }, null, 2))
1112
.click('.child-link')
1213
.assert.urlEquals('http://localhost:8080/route-params/items/1/logs/info')
1314
.assert.containsText('.log', 'id: 1, type: info')
15+
// https://github.com/vuejs/vue-router/issues/2938
16+
.assert.containsText('#params', JSON.stringify({ type: 'info' }, null, 2))
1417

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

0 commit comments

Comments
 (0)