diff options
author | Guillaume Gautreau <guillaume+github@ghusse.com> | 2013-01-27 00:45:21 +0400 |
---|---|---|
committer | Guillaume Gautreau <guillaume+github@ghusse.com> | 2013-01-27 00:45:21 +0400 |
commit | 5b0f956a60d8bd41084a167f83c25e276de11705 (patch) | |
tree | 301d7d8dea4b69626cd4371c1d62ab78fdc8ac62 /js/tests/unit/bootstrap-tooltip.js | |
parent | d9a0abaa06b4e94ffffc921dcb1119b3bb83f522 (diff) |
Arrow replacement
Diffstat (limited to 'js/tests/unit/bootstrap-tooltip.js')
-rw-r--r-- | js/tests/unit/bootstrap-tooltip.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 49c034e2ff..666c417ee1 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -290,5 +290,26 @@ $(function () { ok(tooltip.offset().top + tooltip.outerHeight() <= tooltiped.offset().top); container.remove(); }, 100) - }) + }); + + test("arrow should point to element", function(){ + var container = $("<div />").appendTo("body") + .css({position: "absolute", bottom: 0, left: 0, textAlign: "right", width: 300, height: 300}) + , p = $("<p style='margin-top:200px' />").appendTo(container) + , tooltiped = $("<a href='#' title='very very very very very very very long tooltip'>Hover me</a>") + .css({marginTop: 200}) + .appendTo(p) + .tooltip({placement: "top", animate: false}) + .tooltip("show"); + + stop(); + + setTimeout(function(){ + var arrow = container.find(".tooltip-arrow"); + + start(); + ok(Math.abs(arrow.offset().left - tooltiped.offset().left - tooltiped.outerWidth()/2) <= 1); + container.remove(); + }, 100); + }); }) |