@@ -3,7 +3,7 @@ module.exports = {
33 browser
44 . url ( 'http://localhost:8080/route-matching/' )
55 . waitForElementVisible ( '#app' , 1000 )
6- . assert . count ( 'li a' , 10 )
6+ . assert . count ( 'li a' , 14 )
77 . assert . evaluate ( function ( ) {
88 var route = JSON . parse ( document . querySelector ( 'pre' ) . textContent )
99 return (
@@ -125,6 +125,53 @@ module.exports = {
125125 )
126126 } , null , '/optional-group/foo/bar' )
127127
128+ . click ( 'li:nth-child(11) a' )
129+ . assert . evaluate ( function ( ) {
130+ var route = JSON . parse ( document . querySelector ( 'pre' ) . textContent )
131+ return (
132+ route . matched . length === 1 &&
133+ route . matched [ 0 ] . path === '/FooBar' &&
134+ route . fullPath === '/FooBar' &&
135+ JSON . stringify ( route . params ) === JSON . stringify ( { } ) &&
136+ route . matched [ 0 ] . pathToRegexpOptions . sensitive === true
137+ )
138+ } , null , '/FooBar' )
139+
140+ . click ( 'li:nth-child(12) a' )
141+ . assert . evaluate ( function ( ) {
142+ var route = JSON . parse ( document . querySelector ( 'pre' ) . textContent )
143+ return (
144+ route . matched . length === 1 &&
145+ route . matched [ 0 ] . path === '/FOOBar' &&
146+ route . fullPath === '/FOOBar' &&
147+ JSON . stringify ( route . params ) === JSON . stringify ( { } ) &&
148+ route . matched [ 0 ] . pathToRegexpOptions . sensitive === true
149+ )
150+ } , null , '/FOOBar' )
151+
152+ . click ( 'li:nth-child(13) a' )
153+ . assert . evaluate ( function ( ) {
154+ var route = JSON . parse ( document . querySelector ( 'pre' ) . textContent )
155+ return (
156+ route . matched . length === 1 &&
157+ route . matched [ 0 ] . path === '/foo' &&
158+ route . fullPath === '/foo' &&
159+ JSON . stringify ( route . params ) === JSON . stringify ( { } ) &&
160+ route . matched [ 0 ] . pathToRegexpOptions . sensitive === false
161+ )
162+ } , null , '/foo' )
163+
164+ . click ( 'li:nth-child(14) a' )
165+ . assert . evaluate ( function ( ) {
166+ var route = JSON . parse ( document . querySelector ( 'pre' ) . textContent )
167+ return (
168+ route . matched . length === 1 &&
169+ route . matched [ 0 ] . path === '/foo' &&
170+ route . fullPath === '/FOO' &&
171+ JSON . stringify ( route . params ) === JSON . stringify ( { } ) &&
172+ route . matched [ 0 ] . pathToRegexpOptions . sensitive === false
173+ )
174+ } , null , '/FOOBar' )
128175 . end ( )
129176 }
130177}
0 commit comments