@@ -3,7 +3,7 @@ module.exports = {
3
3
browser
4
4
. url ( 'http://localhost:8080/active-links/' )
5
5
. waitForElementVisible ( '#app' , 1000 )
6
- . assert . count ( 'li a' , 9 )
6
+ . assert . count ( 'li a' , 10 )
7
7
// assert correct href with base
8
8
. assert . attributeContains ( 'li:nth-child(1) a' , 'href' , '/active-links/' )
9
9
. assert . attributeContains ( 'li:nth-child(2) a' , 'href' , '/active-links/' )
@@ -14,6 +14,7 @@ module.exports = {
14
14
. assert . attributeContains ( 'li:nth-child(7) a' , 'href' , '/active-links/users/evan?foo=bar' )
15
15
. assert . attributeContains ( 'li:nth-child(8) a' , 'href' , '/active-links/users/evan?baz=qux&foo=bar' )
16
16
. assert . attributeContains ( 'li:nth-child(9) a' , 'href' , '/active-links/about' )
17
+ . assert . attributeContains ( 'li:nth-child(10) a' , 'href' , '/active-links/about' )
17
18
. assert . containsText ( '.view' , 'Home' )
18
19
19
20
assertActiveLinks ( 1 , [ 1 , 2 ] )
@@ -24,15 +25,19 @@ module.exports = {
24
25
assertActiveLinks ( 6 , [ 1 , 3 , 5 , 6 ] )
25
26
assertActiveLinks ( 7 , [ 1 , 3 , 5 , 7 ] )
26
27
assertActiveLinks ( 8 , [ 1 , 3 , 5 , 7 , 8 ] )
27
- assertActiveLinks ( 9 , [ 1 , 9 ] )
28
+ assertActiveLinks ( 9 , [ 1 , 9 ] , [ 10 ] )
29
+ assertActiveLinks ( 10 , [ 1 , 9 ] , [ 10 ] )
28
30
29
31
browser . end ( )
30
32
31
- function assertActiveLinks ( n , activeOnes ) {
33
+ function assertActiveLinks ( n , activeA , activeLI ) {
32
34
browser . click ( `li:nth-child(${ n } ) a` )
33
- activeOnes . forEach ( i => {
35
+ activeA . forEach ( i => {
34
36
browser . assert . cssClassPresent ( `li:nth-child(${ i } ) a` , 'router-link-active' )
35
37
} )
38
+ activeLI && activeLI . forEach ( i => {
39
+ browser . assert . cssClassPresent ( `li:nth-child(${ i } )` , 'router-link-active' )
40
+ } )
36
41
}
37
42
}
38
43
}
0 commit comments