diff options
author | Chris Rebert <code@rebertia.com> | 2014-06-07 01:49:59 +0400 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2014-06-08 04:54:10 +0400 |
commit | 20c099d41a0802a7f377e7f996c35cade9e0c431 (patch) | |
tree | 08d498ccc41f2a1354bbf7ffc98db63fdac59de2 /js/tests/unit/tooltip.js | |
parent | 3b99a41246cb25b1fba79d14007ed0238409e63f (diff) |
add failing test for #13268
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r-- | js/tests/unit/tooltip.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 2e175583e5..81c0fdf736 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -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 + } + }) }) |