Commit 92959878 authored by Guillaume Gautreau's avatar Guillaume Gautreau
Browse files

Unit test for replacing tooltip inside window

parent 6803ff70
2 merge requests!6821Typeahead updater,!6713Positioning tooltip on edge case
Showing with 19 additions and 1 deletion
+19 -1
......@@ -190,7 +190,7 @@
if (offset.left < 0){
delta = -offset.left * 2;
offset.left = 0;
offset.left = .1;
$tip.offset(offset);
actualWidth = $tip[0].offsetWidth;
actualHeight = $tip[0].offsetHeight;
......
......@@ -251,4 +251,22 @@ $(function () {
ok(!$("#qunit-fixture > .tooltip").length, 'not found in parent')
tooltip.tooltip('hide')
})
test("should place tooltip inside window", function(){
$("#qunit-fixture").show();
var tooltip = $("<a href='#' title='Very very very very very very very very long tooltip'></a>")
.css({position: "absolute", top:0, left: 0})
.appendTo("#qunit-fixture")
.tooltip({placement: "top"})
.tooltip("show");
stop();
setTimeout(function(){
ok($(".tooltip").offset().left >= 0);
start();
$("#qunit-fixture").hide();
}, 200)
});
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment