aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/tooltip.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index 670e6d0c2..9cf3068a3 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -943,4 +943,27 @@ $(function () {
assert.ok(tooltip._popper === null)
})
+
+ QUnit.test('should use Popper.js to get the tip on placement change', function (assert) {
+ assert.expect(1)
+
+ var $tooltip = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>')
+ .appendTo('#qunit-fixture')
+ .bootstrapTooltip()
+
+ var $tipTest = $('<div class="bs-tooltip" />')
+ .appendTo('#qunit-fixture')
+
+ var tooltip = $tooltip.data('bs.tooltip')
+ tooltip.tip = null
+
+ tooltip._handlePopperPlacementChange({
+ instance: {
+ popper: $tipTest[0]
+ },
+ placement: 'auto'
+ })
+
+ assert.ok(tooltip.tip === $tipTest[0])
+ })
})