Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2017-08-24 10:40:11 +0300
committerJohann-S <johann.servoire@gmail.com>2017-08-24 11:33:49 +0300
commit4571ab0e57a5d2ff251b8c174ab0f693c5892dce (patch)
treeea784cc4debeb26ea3121940d2f21448a86b79df /js/tests/unit/tooltip.js
parent3a6fc265f6db182ad8fdc2b1b5b5dadcbb411cfc (diff)
Fix toggle for Tooltips/Popover which was called even if the Tooltip/Popover was disabled
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r--js/tests/unit/tooltip.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index 89d5b70e8b..e4e6bdd6cc 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -826,4 +826,26 @@ $(function () {
$el.bootstrapTooltip('show')
})
+
+ QUnit.test('tooltip should be shown right away after the call of disable/enable', function (assert) {
+ assert.expect(2)
+ var done = assert.async()
+
+ var $trigger = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>')
+ .appendTo('#qunit-fixture')
+ .bootstrapTooltip()
+ .on('shown.bs.tooltip', function () {
+ assert.strictEqual($('.tooltip').hasClass('show'), true)
+ done()
+ })
+
+
+ $trigger.bootstrapTooltip('disable')
+ $trigger.trigger($.Event('click'))
+ setTimeout(function () {
+ assert.strictEqual($('.tooltip').length === 0, true)
+ $trigger.bootstrapTooltip('enable')
+ $trigger.trigger($.Event('click'))
+ }, 200)
+ })
})