Skip to content

Commit c6567ba

Browse files
committed
Tabs tests: Add tests for accessibility of ajax tabs.
1 parent ab260f7 commit c6567ba

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/unit/tabs/tabs_core.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,24 @@ test( "accessibility", function() {
118118
equal( tabs.eq( 2 ).attr( "aria-disabled" ), "true", "disabled tab has aria-disabled=true" );
119119
equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "inactive panel has aria-expanded=false" );
120120
equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "inactive panel has aria-hidden=true" );
121+
});
121122

122-
// TODO: aria-live and aria-busy tests for ajax tabs
123+
asyncTest( "accessibility - ajax", function() {
124+
expect( 4 );
125+
var element = $( "#tabs2" ).tabs(),
126+
tab = element.find( ".ui-tabs-nav li" ).eq( 3 ),
127+
panel = $( "#custom-id" );
128+
129+
equal( panel.attr( "aria-live" ), "polite", "remote panel has aria-live" );
130+
equal( panel.attr( "aria-busy" ), null, "does not have aria-busy on init" );
131+
element.tabs( "option", "active", 3 );
132+
equal( panel.attr( "aria-busy" ), "true", "panel has aria-busy during load" );
133+
element.one( "tabsload", function() {
134+
setTimeout(function() {
135+
equal( panel.attr( "aria-busy" ), null, "panel does not have aria-busy after load" );
136+
start();
137+
}, 1 );
138+
});
123139
});
124140

125141
asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER", function() {

0 commit comments

Comments
 (0)