0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-19 16:54:24 +01:00

add failing test for #13268

This commit is contained in:
Chris Rebert 2014-06-06 14:49:59 -07:00
parent 3b99a41246
commit 20c099d41a

View File

@ -557,4 +557,31 @@ $(function () {
$('head #test').remove()
$('head #viewport-style').remove()
})
test('should not error when trying to show an auto-placed tooltip that has been removed from the dom', function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').appendTo('#qunit-fixture')
tooltip
.one('show.bs.tooltip', function () {
tooltip.remove()
})
.bootstrapTooltip({ placement: 'auto' })
var passed = true
try {
tooltip.bootstrapTooltip('show')
}
catch (err) {
passed = false
console.log(err)
}
ok(passed, '.tooltip(\'show\') should not throw an error in this case')
try {
tooltip.remove()
}
catch (err) {
// tooltip may have already been removed
}
})
})