diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index 3a4a88089..c1af15a2f 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -210,13 +210,18 @@ $(function () {
var done = assert.async()
$('
')
- .on('shown.bs.modal', function () {
+ .one('shown.bs.modal', function () {
$('#close').click()
- ok(!$('#modal-test').is(':visible'), 'modal hidden')
})
.one('hidden.bs.modal', function () {
+ // after one open-close cycle
+ ok(!$('#modal-test').is(':visible'), 'modal hidden')
$(this)
+ .one('shown.bs.modal', function () {
+ $('#close').click()
+ })
.one('hidden.bs.modal', function () {
+ ok(!$('#modal-test').is(':visible'), 'modal hidden')
done()
})
.bootstrapModal('show')