From: Felix Nagel Date: Fri, 31 Mar 2017 20:11:17 +0000 (+0200) Subject: Datepicker tests: Add ARIA tests X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7ef7f3ab9ea8c0e5a778f5b5ae31b6d591275eef;p=jquery-ui.git Datepicker tests: Add ARIA tests --- diff --git a/tests/unit/datepicker/core.js b/tests/unit/datepicker/core.js index 2aa89aa36..e26c6c94d 100644 --- a/tests/unit/datepicker/core.js +++ b/tests/unit/datepicker/core.js @@ -123,9 +123,20 @@ QUnit.test( "Keyboard handling: input", function( assert ) { "Picker updated as user types into input" ); } ); -// TODO: implement QUnit.test( "ARIA", function( assert ) { - assert.expect( 0 ); + assert.expect( 4 ); + + var widget = this.element.datepicker( "widget" ), + id = widget.attr( "id" ); + + assert.equal( this.element.attr( "aria-haspopup" ), "true", + "Input aria-haspopup attribute" ); + assert.equal( this.element.attr( "aria-owns" ), id, "ARIA owns attribute" ); + + assert.equal( widget.attr( "aria-hidden" ), "true", + "Widget ARIA hidden attribute" ); + assert.equal( widget.attr( "aria-expanded" ), "false", + "Widget ARIA expanded attribute" ); } ); QUnit.test( "mouse", function( assert ) {