aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip/tooltip_options.js
diff options
context:
space:
mode:
authorDylan Barrell <dylan@barrell.com>2013-10-26 11:31:07 -0400
committerScott González <scott.gonzalez@gmail.com>2013-12-19 10:36:30 -0500
commitb9e438d07c370ac2d4b198048feb6b6922469f70 (patch)
tree053e2b484fb30ef9ac5ed0579a169edcc6ce2c80 /tests/unit/tooltip/tooltip_options.js
parentc9042b960f5c7b83a52e3b5c79dab2fed03f27e1 (diff)
downloadjquery-ui-b9e438d07c370ac2d4b198048feb6b6922469f70.tar.gz
jquery-ui-b9e438d07c370ac2d4b198048feb6b6922469f70.zip
Tooltip: Improve accessibility by adding content to an aria-live div
Fixes #9610 Closes gh-1118
Diffstat (limited to 'tests/unit/tooltip/tooltip_options.js')
-rw-r--r--tests/unit/tooltip/tooltip_options.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index 01ac25040..bced8e860 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -41,13 +41,16 @@ test( "content: return string", function() {
});
test( "content: return jQuery", function() {
- expect( 1 );
+ expect( 2 );
var element = $( "#tooltipped1" ).tooltip({
content: function() {
- return $( "<div>" ).html( "cu<b>s</b>tomstring" );
+ return $( "<div id='unique'>" ).html( "cu<b id='bold'>s</b>tomstring" );
}
- }).tooltip( "open" );
+ }).tooltip( "open" ),
+ liveRegion = element.tooltip( "instance" ).liveRegion;
deepEqual( $( "#" + element.data( "ui-tooltip-id" ) ).text(), "customstring" );
+ equal( liveRegion.children().last().html(), "<div>cu<b>s</b>tomstring</div>",
+ "The accessibility live region will strip the ids but keep the structure" );
});
asyncTest( "content: sync + async callback", function() {