aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/tooltip.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r--js/tests/unit/tooltip.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index c2e2b937b..2875eff85 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -1168,4 +1168,16 @@ $(function () {
}, new Error('`selector` option must be specified when initializing tooltip on the window.document object!'))
})
+ QUnit.test('should do nothing when an attempt is made to hide an uninitialized tooltip', function (assert) {
+ assert.expect(1)
+
+ var $tooltip = $('<span data-toggle="tooltip" title="some tip">some text</span>')
+ .appendTo('#qunit-fixture')
+ .on('hidden.bs.tooltip shown.bs.tooltip', function () {
+ assert.ok(false, 'should not fire any tooltip events')
+ })
+ .bootstrapTooltip('hide')
+ assert.strictEqual($tooltip.data('bs.tooltip'), undefined, 'should not initialize the tooltip')
+ })
+
})