From 67950d1d3cc59ac79d2b5101178b0cf48ffffaba Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 4 Sep 2018 12:25:03 -0300 Subject: [PATCH] test(history): test initial navigation works with unicode --- examples/basic/app.js | 5 ++++- test/e2e/specs/basic.js | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/examples/basic/app.js b/examples/basic/app.js index 2dbc4b65d..bafe7cbfb 100644 --- a/examples/basic/app.js +++ b/examples/basic/app.js @@ -10,6 +10,7 @@ Vue.use(VueRouter) const Home = { template: '
home
' } const Foo = { template: '
foo
' } const Bar = { template: '
bar
' } +const Unicode = { template: '
unicode
' } // 3. Create the router const router = new VueRouter({ @@ -18,7 +19,8 @@ const router = new VueRouter({ routes: [ { path: '/', component: Home }, { path: '/foo', component: Foo }, - { path: '/bar', component: Bar } + { path: '/bar', component: Bar }, + { path: '/é', component: Unicode } ] }) @@ -37,6 +39,7 @@ new Vue({ /bar +
  • diff --git a/test/e2e/specs/basic.js b/test/e2e/specs/basic.js index 266d6033e..588a98ac8 100644 --- a/test/e2e/specs/basic.js +++ b/test/e2e/specs/basic.js @@ -1,15 +1,16 @@ module.exports = { - 'basic': function (browser) { + basic: function (browser) { browser .url('http://localhost:8080/basic/') .waitForElementVisible('#app', 1000) - .assert.count('li', 4) - .assert.count('li a', 4) + .assert.count('li', 5) + .assert.count('li a', 5) // assert correct href with base .assert.attributeContains('li:nth-child(1) a', 'href', '/basic/') .assert.attributeContains('li:nth-child(2) a', 'href', '/basic/foo') .assert.attributeContains('li:nth-child(3) a', 'href', '/basic/bar') .assert.attributeContains('li:nth-child(4) a', 'href', '/basic/bar') + .assert.attributeContains('li:nth-child(5) a', 'href', '/basic/%C3%A9') .assert.containsText('.view', 'home') .click('li:nth-child(2) a') @@ -28,10 +29,17 @@ module.exports = { .assert.urlEquals('http://localhost:8080/basic/bar') .assert.containsText('.view', 'bar') - // check initial visit + .click('li:nth-child(5) a') + .assert.urlEquals('http://localhost:8080/basic/%C3%A9') + .assert.containsText('.view', 'unicode') + + // check initial visit .url('http://localhost:8080/basic/foo') .waitForElementVisible('#app', 1000) .assert.containsText('.view', 'foo') + .url('http://localhost:8080/basic/%C3%A9') + .waitForElementVisible('#app', 1000) + .assert.containsText('.view', 'unicode') .end() } }