@@ -7,7 +7,7 @@ test("No text = no relevant elements", function() {
77 div . style . color = 'white' ;
88 fixture . appendChild ( div ) ;
99 deepEqual (
10- axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( [ ] , fixture ) ,
10+ axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( { scope : fixture } ) ,
1111 { result : axs . constants . AuditResult . NA }
1212 ) ;
1313} ) ;
@@ -20,7 +20,7 @@ test("Black on white = no problem", function() {
2020 div . textContent = 'Some text' ;
2121 fixture . appendChild ( div ) ;
2222 deepEqual (
23- axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( [ ] , fixture ) ,
23+ axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( { scope : fixture } ) ,
2424 { elements : [ ] , result : axs . constants . AuditResult . PASS }
2525 ) ;
2626} ) ;
@@ -33,20 +33,20 @@ test("Low contrast = fail", function() {
3333 div . textContent = 'Some text' ;
3434 fixture . appendChild ( div ) ;
3535 deepEqual (
36- axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( [ ] , fixture ) ,
36+ axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( { scope : fixture } ) ,
3737 { elements : [ div ] , result : axs . constants . AuditResult . FAIL }
3838 ) ;
3939} ) ;
4040
4141test ( "Opacity is handled" , function ( ) {
4242 // Setup fixture
43- var fixtures = document . getElementById ( 'qunit-fixture' ) ;
43+ var fixture = document . getElementById ( 'qunit-fixture' ) ;
4444 var elementWithOpacity = document . createElement ( 'div' ) ;
4545 elementWithOpacity . style . opacity = '0.4' ;
4646 elementWithOpacity . textContent = 'Some text' ;
47- fixtures . appendChild ( elementWithOpacity ) ;
47+ fixture . appendChild ( elementWithOpacity ) ;
4848 deepEqual (
49- axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( [ ] , fixtures ) ,
49+ axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( { scope : fixture } ) ,
5050 { elements : [ elementWithOpacity ] , result : axs . constants . AuditResult . FAIL }
5151 ) ;
5252} ) ;
@@ -59,7 +59,7 @@ test("Uses tolerance value", function() {
5959 div . textContent = 'Some text' ;
6060 fixture . appendChild ( div ) ;
6161 deepEqual (
62- axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( [ ] , fixture ) ,
62+ axs . AuditRules . getRule ( 'lowContrastElements' ) . run ( { scope : fixture } ) ,
6363 { elements : [ ] , result : axs . constants . AuditResult . PASS }
6464 ) ;
6565} ) ;
0 commit comments