diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-04-15 09:45:35 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-04-15 09:45:35 +0200 |
commit | 84e0ce168f109fbd5482c6c1ba09bbbb55592888 (patch) | |
tree | 2992b7c9a1a36bf227ff01b3f94ffc5913ba696b /tests/unit/tooltip/tooltip_options.js | |
parent | acfc66e1ab4c90897139507124de7365fee4afb9 (diff) | |
download | jquery-ui-84e0ce168f109fbd5482c6c1ba09bbbb55592888.tar.gz jquery-ui-84e0ce168f109fbd5482c6c1ba09bbbb55592888.zip |
Tooltip: Unit tests for tooltip and a fix to pass through event objects to triggered events
Diffstat (limited to 'tests/unit/tooltip/tooltip_options.js')
-rw-r--r-- | tests/unit/tooltip/tooltip_options.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js new file mode 100644 index 000000000..e0262a947 --- /dev/null +++ b/tests/unit/tooltip/tooltip_options.js @@ -0,0 +1,39 @@ +/* + * tooltip_options.js + */ +(function($) { + +module("tooltip: options"); + +function contentTest(name, expected, impl) { + test(name, function() { + $("#tooltipped1").tooltip({ + content: impl + }).tooltip("open"); + same( $(".ui-tooltip").text(), expected ); + $(":ui-tooltip").tooltip("destroy"); + }); +} + +contentTest("content: default", "anchortitle"); +contentTest("content: return string", "customstring", function() { + return "customstring"; +}); +contentTest("content: callback string", "customstring2", function(response) { + response("customstring2"); +}); + +test("tooltipClass, default", function() { + $("#tooltipped1").tooltip().tooltip("open"); + same( $(".ui-tooltip").attr("class"), "ui-tooltip ui-widget ui-corner-all ui-widget-content"); + $(":ui-tooltip").tooltip("destroy"); +}); +test("tooltipClass, custom", function() { + $("#tooltipped1").tooltip({ + tooltipClass: "pretty fancy" + }).tooltip("open"); + same( $(".ui-tooltip").attr("class"), "ui-tooltip ui-widget ui-corner-all pretty fancy"); + $(":ui-tooltip").tooltip("destroy"); +}); + +})(jQuery); |