diff --git a/lib/checks/aria/errormessage.js b/lib/checks/aria/errormessage.js index 9798c35267..d93113fe82 100644 --- a/lib/checks/aria/errormessage.js +++ b/lib/checks/aria/errormessage.js @@ -21,7 +21,7 @@ function validateAttrValue() { // limit results to elements that actually have this attribute if (options.indexOf(attr) === -1 && hasAttr) { if (!validateAttrValue()) { - this.data(attr); + this.data(axe.utils.tokenList(attr)); return false; } } diff --git a/test/checks/aria/errormessage.js b/test/checks/aria/errormessage.js index 3dc4f41a90..bc2eea55f9 100644 --- a/test/checks/aria/errormessage.js +++ b/test/checks/aria/errormessage.js @@ -56,6 +56,16 @@ describe('aria-errormessage', function() { ); }); + it('sets an array of IDs in data', function() { + var testHTML = '
'; + testHTML += '
'; + fixture.innerHTML = testHTML; + var target = fixture.children[0]; + target.setAttribute('aria-errormessage', ' foo bar \tbaz '); + checks['aria-errormessage'].evaluate.call(checkContext, target); + assert.deepEqual(checkContext._data, ['foo', 'bar', 'baz']); + }); + (shadowSupported ? it : xit)( 'should return false if aria-errormessage value crosses shadow boundary', function() {