mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-04-25 06:24:43 +00:00
Merge pull request #2 from lucascono/v4-dev-modal-unit-test
Unit test for modal bug fix
This commit is contained in:
commit
2729d81832
1 changed files with 13 additions and 0 deletions
|
|
@ -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')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue