-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aria-required-children): add aria-busy check (#3569)
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
- Loading branch information
1 parent
9b932fb
commit 3618f50
Showing
6 changed files
with
75 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Checks if element has aria-busy tag set to "true" | ||
* | ||
* @memberof checks | ||
* @return {Boolean} True if node has "aria-busy" attribute. False otherwise | ||
*/ | ||
export default function ariaBusyEvaluate(node, options, virtualNode) { | ||
return virtualNode.attr('aria-busy') === 'true'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"id": "aria-busy", | ||
"evaluate": "aria-busy-evaluate", | ||
"metadata": { | ||
"impact": "serious", | ||
"messages": { | ||
"pass": "Element has an aria-busy attribute", | ||
"fail": "Element has no aria-busy=\"true\" attribute" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe('aria-busy', function() { | ||
'use strict'; | ||
|
||
var checkContext = axe.testUtils.MockCheckContext(); | ||
var checkSetup = axe.testUtils.checkSetup; | ||
var checkEvaluate = axe.testUtils.getCheckEvaluate('aria-busy'); | ||
|
||
afterEach(function() { | ||
checkContext.reset(); | ||
}); | ||
|
||
it('should return false if no aria-busy tag on element', function() { | ||
var params = checkSetup('<div id="target" role="list"></div>'); | ||
assert.isFalse(checkEvaluate.apply(checkContext, params)); | ||
}); | ||
|
||
it('should return false if aria-busy is set to false', function() { | ||
var params = checkSetup( | ||
'<div id="target" role="list" aria-busy="false"></div>' | ||
); | ||
assert.isFalse(checkEvaluate.apply(checkContext, params)); | ||
}); | ||
|
||
it('should return true if aria-busy is set to true', function() { | ||
var params = checkSetup( | ||
'<div id="target" role="list" aria-busy="true"></div>' | ||
); | ||
assert.isTrue(checkEvaluate.apply(checkContext, params)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters