aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-28 15:43:22 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-28 15:43:22 -0400
commit302ad626bfa4fc148c296ed63264e5b90b5b91b5 (patch)
treef6f11a6d5e4dabba4016b4bdafa5f8711d2ccc31 /tests
parente77fcaa6eb660a969605fc2fa2a3f6ed442ef393 (diff)
downloadjquery-ui-302ad626bfa4fc148c296ed63264e5b90b5b91b5.tar.gz
jquery-ui-302ad626bfa4fc148c296ed63264e5b90b5b91b5.zip
Tooltip: Added some tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tooltip/tooltip_core.js19
-rw-r--r--tests/unit/tooltip/tooltip_options.js2
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js
index 055a2927f..d18b85398 100644
--- a/tests/unit/tooltip/tooltip_core.js
+++ b/tests/unit/tooltip/tooltip_core.js
@@ -2,6 +2,25 @@
module( "tooltip: core" );
+test( "markup structure", function() {
+ expect( 6 );
+ var element = $( "#tooltipped1" ).tooltip(),
+ tooltip = $( ".ui-tooltip" );
+ equal( element.attr( "aria-describedby" ), undefined, "no aria-describedby on init" );
+ equal( tooltip.length, 0, "no tooltip on init" );
+
+ element.tooltip( "open" );
+ tooltip = $( "#" + element.attr( "aria-describedby" ) );
+ equal( tooltip.length, 1, "tooltip exists" );
+ ok( tooltip.hasClass( "ui-tooltip" ), "tooltip is .ui-tooltip" );
+ equal( tooltip.length, 1, ".ui-tooltip exists" );
+ equal( tooltip.find( ".ui-tooltip-content" ).length, 1,
+ ".ui-tooltip-content exists" );
+});
+
+test( "accessibility", function() {
+ // TODO: add tests
+});
}( jQuery ) );
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index c9f92c527..c866d219f 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -16,7 +16,7 @@ test( "items", function() {
});
test( "content: default", function() {
- var element = $( "#tooltipped1" ).tooltip().tooltip("open");
+ var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
same( $( "#" + element.attr( "aria-describedby" ) ).text(), "anchortitle" );
});