diff options
| author | Johann <[email protected]> | 2016-12-02 18:52:19 +0100 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-12-02 09:52:19 -0800 |
| commit | 297c47c3fdbb58e3d9824afdee83ef3c4b9d141a (patch) | |
| tree | ca90559ff2025eca6400b6b88b3d609d91f9653f /js/tests/visual/tooltip.html | |
| parent | 1fb6d8c46a560e2e35295440721ba2929f9721b6 (diff) | |
| download | bootstrap-297c47c3fdbb58e3d9824afdee83ef3c4b9d141a.tar.xz bootstrap-297c47c3fdbb58e3d9824afdee83ef3c4b9d141a.zip | |
[V4] Throw error when a plugin is in transition (#17823)
* Throw error when a plugin is in transition
* Add unit tests about plugins in transition
Diffstat (limited to 'js/tests/visual/tooltip.html')
| -rw-r--r-- | js/tests/visual/tooltip.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/visual/tooltip.html b/js/tests/visual/tooltip.html index 999e7eda6..6cd33e7e6 100644 --- a/js/tests/visual/tooltip.html +++ b/js/tests/visual/tooltip.html @@ -42,7 +42,26 @@ <script> $(function () { $('[data-toggle="tooltip"]').tooltip() + testTooltipTransitionError() }) + + // Should throw an error because tooltip is in transition + function testTooltipTransitionError() { + var err = false + $('#btnOne').on('shown.bs.tooltip', function () { + $('#btnOne').tooltip('hide').off('shown.bs.tooltip') + if (!err) { + alert('No error thrown for : testTooltipTransitionError') + } + }) + try { + $('#btnOne').tooltip('show').tooltip('hide') + } + catch (e) { + err = true + console.error(e.message) + } + } </script> </body> </html> |
