Skip to content

Commit

Permalink
better a11y related scenery logging for tests, #715
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 20, 2018
1 parent 502c0c2 commit 9f65bf4
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions js/accessibility/AccessibilityTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ define( function( require ) {
var Rectangle = require( 'SCENERY/nodes/Rectangle' );
var scenery = require( 'SCENERY/scenery' );

QUnit.module( 'Accessibility' );

// constants
var TEST_INNER_CONTENT = 'Test Inner Content Here please^&*. Thanks you so very mucho.';
var TEST_LABEL = 'Test label';
Expand All @@ -43,10 +41,24 @@ define( function( require ) {
// a focus highlight for testing, since dummy nodes tend to have no bounds
var TEST_HIGHLIGHT = new Circle( 5 );

// add scenery logging for a11y in this unit test module, make sure it is turned off at the end of the file.
if ( window.location.search.indexOf( 'a11yLog' ) >= 0 ) {
scenery.enableLogging( ['a11y'] );
}
QUnit.module( 'Accessibility', {
before: function() {
// add scenery logging for a11y in this unit test module, make sure it is turned off at the end of the file.
if ( window.location.search.indexOf( 'a11yLog' ) >= 0 ) {
scenery.enableLogging( [ 'a11y' ] );
}

},
after: function() {
// remove the logging that we added at the top
if ( window.location.search.indexOf( 'a11yLog' ) >= 0 ) {
scenery.disableIndividualLog( 'Accessibility' );
scenery.disableIndividualLog( 'AccessibleInstance' );
scenery.disableIndividualLog( 'AccessibilityTree' );
scenery.disableIndividualLog( 'AccessibleDisplaysInfo' );
}
}
} );

/**
* Get the id of a dom element representing a node in the DOM. The accessible content must exist and be unique,
Expand Down Expand Up @@ -1125,7 +1137,7 @@ define( function( require ) {
QUnit.test( 'helpText option', function( assert ) {


assert.ok( true);
assert.ok( true );
//
// TODO: this is failing, but ideally it wouldn't see https://github.com/phetsims/scenery/issues/811
// // test the behavior of focusable function
Expand Down Expand Up @@ -1199,12 +1211,4 @@ define( function( require ) {
}
assert.expect( 0 );
} );

// remove the logging that we added at the top
if ( window.location.search.indexOf( 'a11yLog' ) >= 0 ) {
scenery.disableIndividualLog( 'Accessibility' );
scenery.disableIndividualLog( 'AccessibleInstance' );
scenery.disableIndividualLog( 'AccessibilityTree' );
scenery.disableIndividualLog( 'AccessibleDisplaysInfo' );
}
} );

0 comments on commit 9f65bf4

Please sign in to comment.