aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorPhil Hughes <[email protected]>2014-09-03 13:11:40 +0100
committerHeinrich Fenkart <[email protected]>2014-10-26 04:38:18 +0100
commit9740d8bb697dadf7dba1c271cce87d0d90c7ac62 (patch)
tree2c3ddbba172977ece1f60a4504a78367b50ce247 /js/tests
parent783eced7abfced5f021e9792405b4cfd6a829bb6 (diff)
downloadbootstrap-9740d8bb697dadf7dba1c271cce87d0d90c7ac62.tar.xz
bootstrap-9740d8bb697dadf7dba1c271cce87d0d90c7ac62.zip
Fix tooltip occasionally not hiding when using a hide delay
Fixes #14375. Closes #14519 by merging it.
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/tooltip.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index 351dd61cb..01c90a81c 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -928,6 +928,36 @@ $(function () {
$tooltip.trigger('mouseenter')
})
+ test('should hide tip after hide delay even if moused left before end of fade in', function () {
+ stop()
+
+ var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip for test"/>')
+ .appendTo('#qunit-fixture')
+ .bootstrapTooltip({ delay: { show: 10, hide: 10 }})
+
+ setTimeout(function () {
+ ok(!$tooltip.data('bs.tooltip').$tip, '1ms: tooltip exists')
+
+ setTimeout(function () {
+ ok($tooltip.data('bs.tooltip').$tip.is('.fade.in'), '10ms: tooltip faded in')
+ }, 10)
+
+ setTimeout(function () {
+ ok($tooltip.data('bs.tooltip').$tip.is('.fade.in'), '15ms: tooltip faded in')
+
+ $tooltip.trigger('mouseout')
+ }, 15)
+
+ setTimeout(function () {
+ ok(!$tooltip.data('bs.tooltip').$tip.is('.fade.in'), '30ms: tooltip faded out')
+
+ start()
+ }, 30)
+ }, 0)
+
+ $tooltip.trigger('mouseenter')
+ })
+
test('should correctly position tooltips on SVG elements', function () {
if (!window.SVGElement) {
// Skip IE8 since it doesn't support SVG