diff --git a/lib/checks/forms/group-labelledby.js b/lib/checks/forms/group-labelledby.js index a9b3e84263..7775cfaab2 100644 --- a/lib/checks/forms/group-labelledby.js +++ b/lib/checks/forms/group-labelledby.js @@ -20,5 +20,5 @@ return [].map.call(matchingNodes, function (m) { }); }).filter(function (n) { var labelNode = doc.getElementById(n); - return labelNode && axe.commons.text.accessibleText(labelNode); + return labelNode && axe.commons.text.accessibleText(labelNode, true); }).length !== 0; diff --git a/test/checks/forms/group-labelledby.js b/test/checks/forms/group-labelledby.js index 0c5c16f83b..37184b0cff 100644 --- a/test/checks/forms/group-labelledby.js +++ b/test/checks/forms/group-labelledby.js @@ -104,6 +104,22 @@ describe('group-labelledby', function () { }); }); + it('should return true if there are ungrouped ' + type + ' elements with the same hidden name and with shared labelledby' + + 'pointing to a node with text content', function () { + + fixtureSetup('
' + + '' + + '' + + ''); + + var node = fixture.querySelector('#target'); + assert.isTrue(check.evaluate.call(checkContext, node)); + assert.deepEqual(checkContext._data, { + name: 'uniqueyname', + type: type + }); + }); + it('should return true if there are ungrouped ' + type + ' elements with the same name and with shared labelledby ' + 'pointing to a node with text content - SPECIAL CHARACTERS', function () {