0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Unit test for modal bug fix

Unit test for pull request #24240
This commit is contained in:
lucascono 2017-10-04 08:55:40 -03:00
parent cc2f5f71ae
commit 47968c8126

View File

@ -673,4 +673,17 @@ $(function () {
$toggleBtn.trigger('click')
setTimeout(done, 500)
})
QUnit.test('should not try to open a modal which is already visible', function (assert) {
assert.expect(1)
var done = assert.async()
var count = 0
$('<div id="modal-test"/>').on('shown.bs.modal', function () {
count++
}).on('hidden.bs.modal', function () {
assert.strictEqual(count, 1, 'show() runs only once')
done()
}).bootstrapModal('show').bootstrapModal('show').bootstrapModal('hide')
})
})