Skip to content

Commit 546144d

Browse files
committed
Initial draft for the aria-modal test
1 parent 22ea1a7 commit 546144d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/unit/dialog/core.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,26 @@ QUnit.test( "ARIA", function( assert ) {
8484
element.remove();
8585
} );
8686

87+
QUnit.test( "aria-modal", function( assert ) {
88+
assert.expect( 3 );
89+
90+
var element = $( "<div>" ).dialog(),
91+
wrapper = element.dialog( "option", "modal", true );
92+
assert.equal( wrapper.attr( "aria-modal" ), "true", "aria-modal attribute set to true" );
93+
element.remove();
94+
95+
var element = $( "<div>" ).dialog(),
96+
wrapper = element.dialog( "option", "modal", false );
97+
assert.equal( wrapper.attr( "aria-modal" ), "false", "aria-modal attribute set to false" );
98+
element.remove();
99+
100+
var element = $( "<div>" ).dialog();
101+
assert.equal( element.dialog( "widget" ).attr( "aria-describedby" ), null, "no aria-modal attribute added" );
102+
element.remove();
103+
104+
} );
105+
106+
87107
QUnit.test( "widget method", function( assert ) {
88108
assert.expect( 1 );
89109
var dialog = $( "<div>" ).appendTo( "#qunit-fixture" ).dialog();

0 commit comments

Comments
 (0)