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-12-02 20:52:19 +0300
committerMark Otto <markd.otto@gmail.com>2016-12-02 20:52:19 +0300
commit297c47c3fdbb58e3d9824afdee83ef3c4b9d141a (patch)
treeca90559ff2025eca6400b6b88b3d609d91f9653f /js/tests/visual/modal.html
parent1fb6d8c46a560e2e35295440721ba2929f9721b6 (diff)
[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/modal.html')
-rw-r--r--js/tests/visual/modal.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/tests/visual/modal.html b/js/tests/visual/modal.html
index fa5bd368aa..69d3923506 100644
--- a/js/tests/visual/modal.html
+++ b/js/tests/visual/modal.html
@@ -188,6 +188,26 @@
}
}
+ // Should throw an error because modal is in transition
+ function testModalTransitionError() {
+ var err = false
+ // Close #myModal
+ $('#myModal').on('shown.bs.modal', function () {
+ $('#myModal').modal('hide').off('shown.bs.modal')
+ if (!err) {
+ alert('No error thrown for : testModalTransitionError')
+ }
+ })
+
+ try {
+ $('#myModal').modal('show').modal('hide')
+ }
+ catch (e) {
+ err = true
+ console.error(e.message)
+ }
+ }
+
$(function () {
$('[data-toggle="popover"]').popover()
$('[data-toggle="tooltip"]').tooltip()
@@ -200,6 +220,7 @@
$('#firefoxModal').on('focus', reportFirefoxTestResult.bind(false))
$('#ff-bug-input').on('focus', reportFirefoxTestResult.bind(true))
})
+ testModalTransitionError()
})
</script>
</body>