Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
19fc0143
Commit
19fc0143
authored
Feb 24, 2015
by
Chris Rebert
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15905 from kkirsche/modalAriaTests
Add unit tests for aria-hidden to modal suite
parents
ecd469ec
30d8cdf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
js/tests/unit/modal.js
js/tests/unit/modal.js
+26
-0
No files found.
js/tests/unit/modal.js
View file @
19fc0143
...
@@ -44,6 +44,17 @@ $(function () {
...
@@ -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 () {
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment