Skip to content

Commit 7ef7f3a

Browse files
committed
Datepicker tests: Add ARIA tests
1 parent b09c7e8 commit 7ef7f3a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/unit/datepicker/core.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,20 @@ QUnit.test( "Keyboard handling: input", function( assert ) {
123123
"Picker updated as user types into input" );
124124
} );
125125

126-
// TODO: implement
127126
QUnit.test( "ARIA", function( assert ) {
128-
assert.expect( 0 );
127+
assert.expect( 4 );
128+
129+
var widget = this.element.datepicker( "widget" ),
130+
id = widget.attr( "id" );
131+
132+
assert.equal( this.element.attr( "aria-haspopup" ), "true",
133+
"Input aria-haspopup attribute" );
134+
assert.equal( this.element.attr( "aria-owns" ), id, "ARIA owns attribute" );
135+
136+
assert.equal( widget.attr( "aria-hidden" ), "true",
137+
"Widget ARIA hidden attribute" );
138+
assert.equal( widget.attr( "aria-expanded" ), "false",
139+
"Widget ARIA expanded attribute" );
129140
} );
130141

131142
QUnit.test( "mouse", function( assert ) {

0 commit comments

Comments
 (0)