]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker tests: Add ARIA tests 1802/head
authorFelix Nagel <info@felixnagel.com>
Fri, 31 Mar 2017 20:11:17 +0000 (22:11 +0200)
committerFelix Nagel <info@felixnagel.com>
Fri, 31 Mar 2017 20:11:17 +0000 (22:11 +0200)
tests/unit/datepicker/core.js

index 2aa89aa3655d811920b22f4f299a3b420d6c0a2d..e26c6c94d558e257e467b1c74b3c8c8c312db545 100644 (file)
@@ -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 ) {