@@ -5,6 +5,7 @@ describe('help-same-as-label', function () {
5
5
6
6
afterEach ( function ( ) {
7
7
fixture . innerHTML = '' ;
8
+ axe . _tree = undefined ;
8
9
} ) ;
9
10
10
11
it ( 'should return true if an element has a label and a title with the same text' , function ( ) {
@@ -14,8 +15,8 @@ describe('help-same-as-label', function () {
14
15
node . setAttribute ( 'aria-label' , 'Duplicate' ) ;
15
16
16
17
fixture . appendChild ( node ) ;
17
-
18
- assert . isTrue ( checks [ 'help-same-as-label' ] . evaluate ( node ) ) ;
18
+ var tree = axe . _tree = axe . utils . getFlattenedTree ( fixture ) ;
19
+ assert . isTrue ( checks [ 'help-same-as-label' ] . evaluate ( node , undefined , axe . utils . getNodeFromTree ( tree [ 0 ] , node ) ) ) ;
19
20
} ) ;
20
21
21
22
it ( 'should return true if an element has a label and aria-describedby with the same text' , function ( ) {
@@ -30,7 +31,8 @@ describe('help-same-as-label', function () {
30
31
fixture . appendChild ( node ) ;
31
32
fixture . appendChild ( dby ) ;
32
33
33
- assert . isTrue ( checks [ 'help-same-as-label' ] . evaluate ( node ) ) ;
34
+ var tree = axe . _tree = axe . utils . getFlattenedTree ( fixture ) ;
35
+ assert . isTrue ( checks [ 'help-same-as-label' ] . evaluate ( node , undefined , axe . utils . getNodeFromTree ( tree [ 0 ] , node ) ) ) ;
34
36
} ) ;
35
37
36
38
@@ -41,7 +43,8 @@ describe('help-same-as-label', function () {
41
43
42
44
fixture . appendChild ( node ) ;
43
45
44
- assert . isFalse ( checks [ 'help-same-as-label' ] . evaluate ( node ) ) ;
46
+ var tree = axe . _tree = axe . utils . getFlattenedTree ( fixture ) ;
47
+ assert . isFalse ( checks [ 'help-same-as-label' ] . evaluate ( node , undefined , axe . utils . getNodeFromTree ( tree [ 0 ] , node ) ) ) ;
45
48
46
49
} ) ;
47
50
@@ -56,7 +59,8 @@ describe('help-same-as-label', function () {
56
59
fixture . appendChild ( node ) ;
57
60
fixture . appendChild ( dby ) ;
58
61
59
- assert . isFalse ( checks [ 'help-same-as-label' ] . evaluate ( node ) ) ;
62
+ var tree = axe . _tree = axe . utils . getFlattenedTree ( fixture ) ;
63
+ assert . isFalse ( checks [ 'help-same-as-label' ] . evaluate ( node , undefined , axe . utils . getNodeFromTree ( tree [ 0 ] , node ) ) ) ;
60
64
} ) ;
61
65
62
66
} ) ;
0 commit comments