diff options
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/bootstrap-tooltip.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 63f4f0b07..c25093420 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -78,6 +78,25 @@ $(function () { }, 100) }) + test("should not show tooltip if leave event occurs before delay expires, even if hide delay is 0", function () { + var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>') + .appendTo('#qunit-fixture') + .tooltip({ delay: { show: 200, hide: 0} }) + + stop() + + tooltip.trigger('mouseenter') + + setTimeout(function () { + ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in') + tooltip.trigger('mouseout') + setTimeout(function () { + ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in') + start() + }, 200) + }, 100) + }) + test("should not show tooltip if leave event occurs before delay expires", function () { var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>') .appendTo('#qunit-fixture') @@ -133,4 +152,4 @@ $(function () { ok($.fn.tooltip.Constructor.prototype.isHTML($('<div></div>')), 'correctly detected html') }) -})
\ No newline at end of file +}) |
