mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
Add test unit to check logic of ignoreBackdropClick (#18245)
This commit is contained in:
parent
990a901e52
commit
ce18a66809
@ -174,6 +174,19 @@ $(function () {
|
|||||||
.bootstrapModal('show')
|
.bootstrapModal('show')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
QUnit.test('should not close modal when clicking outside of modal-content if data-backdrop="true"', function (assert) {
|
||||||
|
assert.expect(1)
|
||||||
|
var done = assert.async()
|
||||||
|
|
||||||
|
$('<div id="modal-test" data-backdrop="false"><div class="contents"/></div>')
|
||||||
|
.on('shown.bs.modal', function () {
|
||||||
|
$('#modal-test').trigger('click')
|
||||||
|
assert.ok($('#modal-test').is(':visible'), 'modal not hidden')
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
.bootstrapModal('show')
|
||||||
|
})
|
||||||
|
|
||||||
QUnit.test('should close modal when escape key is pressed via keydown', function (assert) {
|
QUnit.test('should close modal when escape key is pressed via keydown', function (assert) {
|
||||||
assert.expect(3)
|
assert.expect(3)
|
||||||
var done = assert.async()
|
var done = assert.async()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user