aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip/tooltip_options.js
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-10-26 14:26:53 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-10-26 14:26:53 +0200
commit61b4b3e445b0065774f22151d02aab2e8e4be245 (patch)
tree8d5db26292465b3c6fc0472161294d0a942b0d48 /tests/unit/tooltip/tooltip_options.js
parent732a485676a1dcbefc16fdb9d26774b622410138 (diff)
downloadjquery-ui-61b4b3e445b0065774f22151d02aab2e8e4be245.tar.gz
jquery-ui-61b4b3e445b0065774f22151d02aab2e8e4be245.zip
Tooltip: Unit tests cleanup
Diffstat (limited to 'tests/unit/tooltip/tooltip_options.js')
-rw-r--r--tests/unit/tooltip/tooltip_options.js44
1 files changed, 29 insertions, 15 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index e0262a947..f7abddb8b 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -3,24 +3,38 @@
*/
(function($) {
-module("tooltip: options");
-
-function contentTest(name, expected, impl) {
- test(name, function() {
- $("#tooltipped1").tooltip({
- content: impl
- }).tooltip("open");
- same( $(".ui-tooltip").text(), expected );
+module("tooltip: options", {
+ teardown: function() {
$(":ui-tooltip").tooltip("destroy");
- });
-}
+ }
+});
+
+test("content: default", function() {
+ $("#tooltipped1").tooltip().tooltip("open");
+ same( $(".ui-tooltip").text(), "anchortitle" );
+});
-contentTest("content: default", "anchortitle");
-contentTest("content: return string", "customstring", function() {
- return "customstring";
+test("content: return string", function() {
+ $("#tooltipped1").tooltip({
+ content: function() {
+ return "customstring";
+ }
+ }).tooltip("open");
+ same( $(".ui-tooltip").text(), "customstring" );
});
-contentTest("content: callback string", "customstring2", function(response) {
- response("customstring2");
+
+test("content: callback string", function() {
+ stop();
+ $("#tooltipped1").tooltip({
+ content: function(response) {
+ response("customstring2");
+ setTimeout(function() {
+ same( $(".ui-tooltip").text(), "customstring2" );
+ start();
+ }, 100)
+ }
+ }).tooltip("open");
+
});
test("tooltipClass, default", function() {