Skip to content

Commit c79a724

Browse files
Add hash mode deeplinking test
1 parent 0c238c4 commit c79a724

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Diff for: test/e2e/specs/hash-mode.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
'Hash mode': function (browser) {
33
browser
44
.url('http://localhost:8080/hash-mode/')
5-
.waitForElementVisible('#app', 1000)
5+
.waitForElementVisible('#app', 2000)
66
.assert.count('li', 5)
77
.assert.count('li a', 4)
88
.assert.attributeContains('li:nth-child(1) a', 'href', '/hash-mode/#/')
@@ -27,13 +27,25 @@ module.exports = {
2727
.assert.urlEquals('http://localhost:8080/hash-mode/#/bar')
2828
.assert.containsText('.view', 'bar')
2929

30-
// check initial visit
30+
// check initial visit
3131
.url('http://localhost:8080/hash-mode/#/foo')
3232
.waitForElementVisible('#app', 1000)
3333
.assert.containsText('.view', 'foo')
3434
.url('http://localhost:8080/hash-mode/#/%C3%A9')
3535
.waitForElementVisible('#app', 1000)
3636
.assert.containsText('.view', 'unicode')
3737
.end()
38+
39+
// check hash placed correctly
40+
.url('http://localhost:8080/hash-mode/foo?page=123')
41+
.waitForElementVisible('#app', 1000)
42+
.assert.urlEquals('http://localhost:8080/hash-mode/#/foo?page=123')
43+
.assert.count('li', 4)
44+
.assert.count('li a', 3)
45+
.assert.attributeContains('li:nth-child(1) a', 'href', '/hash-mode/#/')
46+
.assert.attributeContains('li:nth-child(2) a', 'href', '/hash-mode/#/foo')
47+
.assert.attributeContains('li:nth-child(3) a', 'href', '/hash-mode/#/bar')
48+
.assert.containsText('.view', 'foo')
49+
.end()
3850
}
3951
}

0 commit comments

Comments
 (0)