mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-14 18:42:30 +03:00
Making .tooltip('show') throw an error on elements with display:none (#20940)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user