diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-05-28 16:20:46 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-28 16:20:46 -0400 |
commit | 666b53a90c70f9689956ee32f208cace021c42a9 (patch) | |
tree | 786bbe1978a563c141960e304f02fbcdca04d64d /tests/unit/tooltip/tooltip_methods.js | |
parent | 2fbd310a159c4f5d54a38b406bb559dc1fb35449 (diff) | |
download | jquery-ui-666b53a90c70f9689956ee32f208cace021c42a9.tar.gz jquery-ui-666b53a90c70f9689956ee32f208cace021c42a9.zip |
Tooltip tests: Refactored and added some tests.
Diffstat (limited to 'tests/unit/tooltip/tooltip_methods.js')
-rw-r--r-- | tests/unit/tooltip/tooltip_methods.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index cb99ea457..1487672cb 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -3,15 +3,25 @@ module( "tooltip: methods" ); test( "destroy", function() { - var beforeHtml = $( "#tooltipped1" ).parent().html(); - var afterHtml = $( "#tooltipped1" ).tooltip().tooltip( "destroy" ).parent().html(); - equal( afterHtml, beforeHtml ); + domEqual( "#tooltipped1", function() { + $( "#tooltipped1" ).tooltip().tooltip( "destroy" ); + }); }); -test( "open", function() { +test( "open/close", function() { + expect( 3 ); + $.fx.off = true; var element = $( "#tooltipped1" ).tooltip(); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" ); +$( ".ui-tooltip" ).each(function() { + console.log( $( this ).html() ); +}); element.tooltip( "open" ); - ok( $( ".ui-tooltip" ).is( ":visible" ) ); + var tooltip = $( "#" + element.attr( "aria-describedby" ) ); + ok( tooltip.is( ":visible" ) ); + element.tooltip( "close" ); + ok( tooltip.is( ":hidden" ) ); + $.fx.off = false; }); /* |