aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/tooltip.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-01-18 14:11:55 -0800
committerMark Otto <[email protected]>2014-01-18 14:11:55 -0800
commitcd1bea0616a8fb1b94d8021bc8dbc0cbc2eaf4aa (patch)
tree0c0a716f3f567c7bd17fb9f6fb254100d78d0e18 /js/tests/unit/tooltip.js
parentb121207e10ad20e6d1d8dc269f71697ad26a67e6 (diff)
parentb1721f42cc8298fb691530614ee6d52389872e25 (diff)
downloadbootstrap-cd1bea0616a8fb1b94d8021bc8dbc0cbc2eaf4aa.tar.xz
bootstrap-cd1bea0616a8fb1b94d8021bc8dbc0cbc2eaf4aa.zip
Merge branch 'master' into bg-variant
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r--js/tests/unit/tooltip.js17
1 files changed, 6 insertions, 11 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index d921bee7f..b9b003dd1 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -332,7 +332,7 @@ $(function () {
var tooltip = container.find('.tooltip')
start()
- ok(tooltip.offset().top + tooltip.outerHeight() <= tooltiped.offset().top)
+ ok(Math.round(tooltip.offset().top + tooltip.outerHeight()) <= Math.round(tooltiped.offset().top))
container.remove()
}, 100)
})
@@ -347,7 +347,11 @@ $(function () {
.tooltip('show'),
tooltip = container.find('.tooltip')
- ok( Math.round(target.offset().top + (target[0].offsetHeight / 2) - (tooltip[0].offsetHeight / 2)) === Math.round(tooltip.offset().top) )
+ // this is some dumb hack shit because sub pixels in firefox
+ var top = Math.round(target.offset().top + (target[0].offsetHeight / 2) - (tooltip[0].offsetHeight / 2))
+ var top2 = Math.round(tooltip.offset().top)
+ var topDiff = top - top2
+ ok(topDiff <= 1 && topDiff >= -1)
target.tooltip('hide')
})
@@ -402,7 +406,6 @@ $(function () {
.tooltip({placement: 'auto'})
.tooltip('show')
-
ok($('.tooltip').is('.bottom'), 'top positioned tooltip is dynamically positioned bottom')
topTooltip.tooltip('hide')
@@ -415,14 +418,6 @@ $(function () {
ok($('.tooltip').is('.left'), 'right positioned tooltip is dynamically positioned left')
rightTooltip.tooltip('hide')
- var bottomTooltip = $('<div style="display: inline-block; position: absolute; bottom: 0;" rel="tooltip" title="Bottom tooltip">Bottom Dynamic Tooltip</div>')
- .appendTo('#dynamic-tt-test')
- .tooltip({placement: 'auto bottom'})
- .tooltip('show')
-
- ok($('.tooltip').is('.top'), 'bottom positioned tooltip is dynamically positioned top')
- bottomTooltip.tooltip('hide')
-
var leftTooltip = $('<div style="display: inline-block; position: absolute; left: 0;" rel="tooltip" title="Left tooltip">Left Dynamic Tooltip</div>')
.appendTo('#dynamic-tt-test')
.tooltip({placement: 'auto left'})