From e57a2f244ba8446fffe71847e6a58b18f7b2d541 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 30 Apr 2018 10:49:43 +0200 Subject: fix(tooltip): get tip on placement change --- js/tests/unit/tooltip.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'js/tests/unit/tooltip.js') diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 670e6d0c2e..9cf3068a36 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 = $('') + .appendTo('#qunit-fixture') + .bootstrapTooltip() + + var $tipTest = $('
') + .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]) + }) }) -- cgit v1.2.3