Skip to content

Commit 67950d1

Browse files
committed
test(history): test initial navigation works with unicode
1 parent c3b0a33 commit 67950d1

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

examples/basic/app.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Vue.use(VueRouter)
1010
const Home = { template: '<div>home</div>' }
1111
const Foo = { template: '<div>foo</div>' }
1212
const Bar = { template: '<div>bar</div>' }
13+
const Unicode = { template: '<div>unicode</div>' }
1314

1415
// 3. Create the router
1516
const router = new VueRouter({
@@ -18,7 +19,8 @@ const router = new VueRouter({
1819
routes: [
1920
{ path: '/', component: Home },
2021
{ path: '/foo', component: Foo },
21-
{ path: '/bar', component: Bar }
22+
{ path: '/bar', component: Bar },
23+
{ path: '/é', component: Unicode }
2224
]
2325
})
2426

@@ -37,6 +39,7 @@ new Vue({
3739
<router-link tag="li" to="/bar" :event="['mousedown', 'touchstart']">
3840
<a>/bar</a>
3941
</router-link>
42+
<li><router-link to="/é">/é</router-link></li>
4043
</ul>
4144
<router-view class="view"></router-view>
4245
</div>

test/e2e/specs/basic.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
module.exports = {
2-
'basic': function (browser) {
2+
basic: function (browser) {
33
browser
44
.url('http://localhost:8080/basic/')
55
.waitForElementVisible('#app', 1000)
6-
.assert.count('li', 4)
7-
.assert.count('li a', 4)
6+
.assert.count('li', 5)
7+
.assert.count('li a', 5)
88
// assert correct href with base
99
.assert.attributeContains('li:nth-child(1) a', 'href', '/basic/')
1010
.assert.attributeContains('li:nth-child(2) a', 'href', '/basic/foo')
1111
.assert.attributeContains('li:nth-child(3) a', 'href', '/basic/bar')
1212
.assert.attributeContains('li:nth-child(4) a', 'href', '/basic/bar')
13+
.assert.attributeContains('li:nth-child(5) a', 'href', '/basic/%C3%A9')
1314
.assert.containsText('.view', 'home')
1415

1516
.click('li:nth-child(2) a')
@@ -28,10 +29,17 @@ module.exports = {
2829
.assert.urlEquals('http://localhost:8080/basic/bar')
2930
.assert.containsText('.view', 'bar')
3031

31-
// check initial visit
32+
.click('li:nth-child(5) a')
33+
.assert.urlEquals('http://localhost:8080/basic/%C3%A9')
34+
.assert.containsText('.view', 'unicode')
35+
36+
// check initial visit
3237
.url('http://localhost:8080/basic/foo')
3338
.waitForElementVisible('#app', 1000)
3439
.assert.containsText('.view', 'foo')
40+
.url('http://localhost:8080/basic/%C3%A9')
41+
.waitForElementVisible('#app', 1000)
42+
.assert.containsText('.view', 'unicode')
3543
.end()
3644
}
3745
}

0 commit comments

Comments
 (0)