From 7652d326e42b471bd3c934debfaf956fa4c67465 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Sun, 18 Aug 2019 22:15:21 +0300 Subject: Backport #29251 allow to pass popper.js configuration for tooltip/popover and dropdown --- js/tests/unit/tooltip.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'js/tests/unit/tooltip.js') diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index e66450fb85..2149a68916 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -1266,4 +1266,21 @@ $(function () { assert.strictEqual(tooltip.config.sanitize, true) }) + + QUnit.test('should allow to pass config to popper.js with `popperConfig`', function (assert) { + assert.expect(1) + + var $trigger = $('') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ + popperConfig: { + placement: 'left' + } + }) + + var tooltip = $trigger.data('bs.tooltip') + var popperConfig = tooltip._getPopperConfig('top') + + assert.strictEqual(popperConfig.placement, 'left') + }) }) -- cgit v1.2.3