-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2017, University of Colorado Boulder | ||
|
||
/** | ||
* Accessibility tests | ||
* | ||
* @author Sam Reid (PhET Interactive Simulations) | ||
*/ | ||
define( function( require ) { | ||
'use strict'; | ||
|
||
// modules | ||
var AccessibilityUtil = require( 'SCENERY/accessibility/AccessibilityUtil' ); | ||
|
||
QUnit.module( 'AccessibilityUtilTests' ); | ||
|
||
|
||
QUnit.test( 'insertElements', function( assert ) { | ||
|
||
var div1 = document.createElement( 'div1' ); | ||
var div2 = document.createElement( 'div2' ); | ||
var div3 = document.createElement( 'div3' ); | ||
var div4 = document.createElement( 'div4' ); | ||
|
||
AccessibilityUtil.insertElements( div1, [ div2, div3, div4 ] ); | ||
|
||
assert.ok( div1.childNodes.length === 3, 'inserted number of elements'); | ||
assert.ok( div1.childNodes[0] === div2, 'inserted div2 order of elements'); | ||
assert.ok( div1.childNodes[1] === div3, 'inserted div3 order of elements'); | ||
assert.ok( div1.childNodes[2] === div4, 'inserted div4 order of elements'); | ||
|
||
|
||
var div5 = document.createElement( 'div5' ); | ||
var div6 = document.createElement( 'div6' ); | ||
var div7 = document.createElement( 'div7' ); | ||
|
||
AccessibilityUtil.insertElements( div1, [div5,div6,div7], div3); | ||
assert.ok( div1.childNodes[0] === div2, 'inserted div2 order of elements'); | ||
assert.ok( div1.childNodes[1] === div5, 'inserted div5 order of elements'); | ||
assert.ok( div1.childNodes[2] === div6, 'inserted div6 order of elements'); | ||
assert.ok( div1.childNodes[3] === div7, 'inserted div7 order of elements'); | ||
assert.ok( div1.childNodes[4] === div3, 'inserted div3 order of elements'); | ||
assert.ok( div1.childNodes[5] === div4, 'inserted div4 order of elements'); | ||
} ); | ||
|
||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters