@@ -9,8 +9,8 @@ module.exports = {
9
9
browser
10
10
. url ( 'http://localhost:8080/basic/' )
11
11
. waitForElementVisible ( '#app' , 1000 )
12
- . assert . count ( 'li' , 9 )
13
- . assert . count ( 'li a' , 9 )
12
+ . assert . count ( 'li' , 11 )
13
+ . assert . count ( 'li a' , 11 )
14
14
// assert correct href with base
15
15
. assert . attributeContains ( 'li:nth-child(1) a' , 'href' , '/basic/' )
16
16
. assert . attributeContains ( 'li:nth-child(2) a' , 'href' , '/basic/foo' )
@@ -76,5 +76,19 @@ module.exports = {
76
76
. assert . containsText ( '#popstate-count' , '0 popstate listeners' )
77
77
78
78
. end ( )
79
+ } ,
80
+
81
+ 'cancelling ongoing navigations' : function ( browser ) {
82
+ browser
83
+ . url ( 'http://localhost:8080/basic/?delay=200' )
84
+ . waitForElementVisible ( '#app' , 1000 )
85
+ . assert . containsText ( '.view' , 'home' )
86
+ // go to foo with a delay
87
+ . click ( 'li:nth-child(11) a' )
88
+ . click ( 'li:nth-child(10) a' )
89
+ . waitFor ( 300 )
90
+ // we should stay at /basic after the delay
91
+ . assert . urlEquals ( 'http://localhost:8080/basic/?delay=200' )
92
+ . assert . containsText ( '.view' , 'home' )
79
93
}
80
94
}
0 commit comments