Skip to content

Commit c6f957a

Browse files
author
Kevin Smithson
committed
fixed tests and added 2 tests for case sensitive redirects
1 parent ba6b3b8 commit c6f957a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

examples/redirect/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ new Vue({
108108
</router-link></li>
109109
110110
<li><router-link to="/FooBar">
111-
/FooBar (redirects to /bar)
111+
/FooBar (redirects to /FOOBAR)
112112
</router-link></li>
113113
114114
<li><router-link to="/not-found">

test/e2e/specs/redirect.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
browser
44
.url('http://localhost:8080/redirect/')
55
.waitForElementVisible('#app', 1000)
6-
.assert.count('li a', 10)
6+
.assert.count('li a', 12)
77
// assert correct href with base
88
.assert.attributeContains('li:nth-child(1) a', 'href', '/redirect/relative-redirect')
99
.assert.attributeContains('li:nth-child(2) a', 'href', '/redirect/relative-redirect?foo=bar')
@@ -14,7 +14,9 @@ module.exports = {
1414
.assert.attributeContains('li:nth-child(7) a', 'href', '/redirect/dynamic-redirect#baz')
1515
.assert.attributeContains('li:nth-child(8) a', 'href', '/redirect/named-redirect')
1616
.assert.attributeContains('li:nth-child(9) a', 'href', '/redirect/redirect-with-params/123')
17-
.assert.attributeContains('li:nth-child(10) a', 'href', '/not-found')
17+
.assert.attributeContains('li:nth-child(10) a', 'href', '/redirect/foobar')
18+
.assert.attributeContains('li:nth-child(11) a', 'href', '/redirect/FooBar')
19+
.assert.attributeContains('li:nth-child(12) a', 'href', '/not-found')
1820

1921
.assert.containsText('.view', 'default')
2022

@@ -58,6 +60,14 @@ module.exports = {
5860
.assert.urlEquals('http://localhost:8080/redirect/')
5961
.assert.containsText('.view', 'default')
6062

63+
.click('li:nth-child(11) a')
64+
.assert.urlEquals('http://localhost:8080/redirect/')
65+
.assert.containsText('.view', 'default')
66+
67+
.click('li:nth-child(12) a')
68+
.assert.urlEquals('http://localhost:8080/redirect/')
69+
.assert.containsText('.view', 'default')
70+
6171
// check initial visit
6272
.url('http://localhost:8080/redirect/relative-redirect')
6373
.waitForElementVisible('#app', 1000)

0 commit comments

Comments
 (0)