Skip to content

Commit

Permalink
Initial draft for the aria-modal test
Browse files Browse the repository at this point in the history
  • Loading branch information
rpkoller committed Jun 11, 2024
1 parent 22ea1a7 commit 546144d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/unit/dialog/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ QUnit.test( "ARIA", function( assert ) {
element.remove();
} );

QUnit.test( "aria-modal", function( assert ) {
assert.expect( 3 );

var element = $( "<div>" ).dialog(),
wrapper = element.dialog( "option", "modal", true );
assert.equal( wrapper.attr( "aria-modal" ), "true", "aria-modal attribute set to true" );
element.remove();

var element = $( "<div>" ).dialog(),
wrapper = element.dialog( "option", "modal", false );
assert.equal( wrapper.attr( "aria-modal" ), "false", "aria-modal attribute set to false" );
element.remove();

var element = $( "<div>" ).dialog();
assert.equal( element.dialog( "widget" ).attr( "aria-describedby" ), null, "no aria-modal attribute added" );
element.remove();

} );


QUnit.test( "widget method", function( assert ) {
assert.expect( 1 );
var dialog = $( "<div>" ).appendTo( "#qunit-fixture" ).dialog();
Expand Down

0 comments on commit 546144d

Please sign in to comment.