mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-07 04:54:24 +01:00
Merge pull request #15905 from kkirsche/modalAriaTests
Add unit tests for aria-hidden to modal suite
This commit is contained in:
commit
19fc014397
@ -44,6 +44,17 @@ $(function () {
|
|||||||
.bootstrapModal('show')
|
.bootstrapModal('show')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
QUnit.test('should set aria-hidden to false when show method is called', function (assert) {
|
||||||
|
var done = assert.async()
|
||||||
|
|
||||||
|
$('<div id="modal-test"/>')
|
||||||
|
.on('shown.bs.modal', function () {
|
||||||
|
assert.strictEqual($('#modal-test').attr('aria-hidden'), 'false', 'aria-hidden is set to string "false" when modal shown')
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
.bootstrapModal('show')
|
||||||
|
})
|
||||||
|
|
||||||
QUnit.test('should fire show event', function (assert) {
|
QUnit.test('should fire show event', function (assert) {
|
||||||
var done = assert.async()
|
var done = assert.async()
|
||||||
|
|
||||||
@ -86,6 +97,21 @@ $(function () {
|
|||||||
.bootstrapModal('show')
|
.bootstrapModal('show')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
QUnit.test('should set aria-hidden to true when hide is called', function (assert) {
|
||||||
|
var done = assert.async()
|
||||||
|
|
||||||
|
$('<div id="modal-test"/>')
|
||||||
|
.on('shown.bs.modal', function () {
|
||||||
|
assert.strictEqual($('#modal-test').length, 1, 'modal has been inserted into the dom')
|
||||||
|
$(this).bootstrapModal('hide')
|
||||||
|
})
|
||||||
|
.on('hidden.bs.modal', function () {
|
||||||
|
assert.strictEqual($('#modal-test').attr('aria-hidden'), 'true', 'aria-hidden is set to string "true" when modal shown')
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
.bootstrapModal('show')
|
||||||
|
})
|
||||||
|
|
||||||
QUnit.test('should toggle when toggle is called', function (assert) {
|
QUnit.test('should toggle when toggle is called', function (assert) {
|
||||||
var done = assert.async()
|
var done = assert.async()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user