diff options
author | Max Beatty <max@beatty.me> | 2016-12-27 03:21:27 +0300 |
---|---|---|
committer | Mark Otto <markd.otto@gmail.com> | 2016-12-28 01:19:12 +0300 |
commit | aa7f95fd777b5a733bc85c158919d206e05a61b5 (patch) | |
tree | ebd8c30addaa1634235871546f8246d5ae6a6341 /js/tests/unit/tooltip.js | |
parent | 8a3d0d344b4eadd78f98809cdf7161b21436b765 (diff) |
update click state when hiding so can be shown again by trigger. fixes #16732
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r-- | js/tests/unit/tooltip.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 1e59f0958f..7ff967fabc 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -818,4 +818,25 @@ $(function () { }) }) + QUnit.test('should show on first trigger after hide', function (assert) { + assert.expect(3) + var $el = $('<a href="#" rel="tooltip" title="Test tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ trigger: 'click hover focus', animation: false }) + + var tooltip = $el.data('bs.tooltip') + var $tooltip = $(tooltip.getTipElement()) + + function showingTooltip() { return $tooltip.hasClass('show') || tooltip._hoverState === 'show' } + + $el.trigger('click') + assert.ok(showingTooltip(), 'tooltip is faded in') + + $el.bootstrapTooltip('hide') + assert.ok(!showingTooltip(), 'tooltip was faded out') + + $el.trigger('click') + assert.ok(showingTooltip(), 'tooltip is faded in again') + }) + }) |