@@ -3,7 +3,7 @@ module.exports = {
33 browser
44 . url ( 'http://localhost:8080/active-links/' )
55 . waitForElementVisible ( '#app' , 1000 )
6- . assert . count ( 'li a' , 9 )
6+ . assert . count ( 'li a' , 10 )
77 // assert correct href with base
88 . assert . attributeContains ( 'li:nth-child(1) a' , 'href' , '/active-links/' )
99 . assert . attributeContains ( 'li:nth-child(2) a' , 'href' , '/active-links/' )
@@ -14,6 +14,7 @@ module.exports = {
1414 . assert . attributeContains ( 'li:nth-child(7) a' , 'href' , '/active-links/users/evan?foo=bar' )
1515 . assert . attributeContains ( 'li:nth-child(8) a' , 'href' , '/active-links/users/evan?baz=qux&foo=bar' )
1616 . assert . attributeContains ( 'li:nth-child(9) a' , 'href' , '/active-links/about' )
17+ . assert . attributeContains ( 'li:nth-child(10) a' , 'href' , '/active-links/about' )
1718 . assert . containsText ( '.view' , 'Home' )
1819
1920 assertActiveLinks ( 1 , [ 1 , 2 ] )
@@ -24,15 +25,19 @@ module.exports = {
2425 assertActiveLinks ( 6 , [ 1 , 3 , 5 , 6 ] )
2526 assertActiveLinks ( 7 , [ 1 , 3 , 5 , 7 ] )
2627 assertActiveLinks ( 8 , [ 1 , 3 , 5 , 7 , 8 ] )
27- assertActiveLinks ( 9 , [ 1 , 9 ] )
28+ assertActiveLinks ( 9 , [ 1 , 9 ] , [ 10 ] )
29+ assertActiveLinks ( 10 , [ 1 , 9 ] , [ 10 ] )
2830
2931 browser . end ( )
3032
31- function assertActiveLinks ( n , activeOnes ) {
33+ function assertActiveLinks ( n , activeA , activeLI ) {
3234 browser . click ( `li:nth-child(${ n } ) a` )
33- activeOnes . forEach ( i => {
35+ activeA . forEach ( i => {
3436 browser . assert . cssClassPresent ( `li:nth-child(${ i } ) a` , 'router-link-active' )
3537 } )
38+ activeLI && activeLI . forEach ( i => {
39+ browser . assert . cssClassPresent ( `li:nth-child(${ i } )` , 'router-link-active' )
40+ } )
3641 }
3742 }
3843}
0 commit comments