Skip to content

Commit a823712

Browse files
committed
fix(aria-valid-attr-value): more thorough test coverage
- messageKey added to unit test - integration test Refs: #4363
1 parent 551ba24 commit a823712

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

test/checks/aria/valid-attr-value.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ describe('aria-valid-attr-value', function () {
117117
assert.isUndefined(
118118
validAttrValueCheck.call(checkContext, null, null, vNode)
119119
);
120+
assert.deepEqual(checkContext._data, {
121+
messageKey: 'controlsWithinPopup',
122+
needsReview: 'aria-controls="test"'
123+
});
120124
});
121125

122126
it('should pass on aria-owns and aria-expanded=false when the element is not in the DOM', function () {

test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,7 @@ <h2>Possible False Positives</h2>
360360
<div role="checkbox" id="incomplete6" aria-checked>I'm not checked</div>
361361
<div role="textbox" id="incomplete7" aria-invalid="">I'm actually valid</div>
362362
<div role="textbox" id="incomplete8" aria-hidden>I'm not really gone</div>
363+
<div id="incomplete9" aria-controls="stuff" aria-haspopup="true">
364+
May have injected html to control dynamically later, who knows!
365+
</div>
363366
</div>

test/integration/rules/aria-valid-attr-value/aria-valid-attr-value.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
["#incomplete5"],
237237
["#incomplete6"],
238238
["#incomplete7"],
239-
["#incomplete8"]
239+
["#incomplete8"],
240+
["#incomplete9"]
240241
]
241242
}

0 commit comments

Comments
 (0)