diff options
| author | fat <[email protected]> | 2014-01-16 14:25:28 -0800 |
|---|---|---|
| committer | fat <[email protected]> | 2014-01-16 14:25:28 -0800 |
| commit | 82ff4e2e40a3f81c569cc46c1ae1f10ffde9e6ad (patch) | |
| tree | d6f3afd441e42ae5ea04bb08f2e68ef579183bfe /js | |
| parent | 3b2418e6885d31d9cd1eab33b4cb952e876f8cf7 (diff) | |
| download | bootstrap-82ff4e2e40a3f81c569cc46c1ae1f10ffde9e6ad.tar.xz bootstrap-82ff4e2e40a3f81c569cc46c1ae1f10ffde9e6ad.zip | |
tooltip subpixel test fixes
Diffstat (limited to 'js')
| -rw-r--r-- | js/tests/unit/tooltip.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index fa1ad57fe..087de80dd 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') }) |
