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 <johann.servoire@gmail.com>2016-11-01 06:33:53 +0300
committerMark Otto <markd.otto@gmail.com>2016-11-01 06:33:53 +0300
commita7f1b59959b12ab2e78c32e6954d083601ad45ba (patch)
tree031ec6da859411b97efa52a549e4cbfc15b791dd /js/tests/unit/tooltip.js
parent0974267b8c2b137d563d36c2390b4491fb1e0309 (diff)
Making .tooltip('show') throw an error on elements with display:none (#20940)
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r--js/tests/unit/tooltip.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index de313ff953..97c5855cb0 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -185,6 +185,19 @@ $(function () {
.bootstrapTooltip('show')
})
+ QUnit.test('should throw an error when show is called on hidden elements', function (assert) {
+ assert.expect(1)
+ var done = assert.async()
+
+ try {
+ $('<div title="tooltip title" style="display: none"/>').bootstrapTooltip('show')
+ }
+ catch (err) {
+ assert.strictEqual(err.message, 'Please use show on visible elements')
+ done()
+ }
+ })
+
QUnit.test('should fire inserted event', function (assert) {
assert.expect(2)
var done = assert.async()