Skip to content

Commit

Permalink
fix(button-name): work with serial virtual node (#2351)
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Jul 9, 2020
1 parent 63ca388 commit efa0e56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/checks/shared/button-has-visible-text.json
Expand Up @@ -5,7 +5,8 @@
"impact": "critical",
"messages": {
"pass": "Element has inner text that is visible to screen readers",
"fail": "Element does not have inner text that is visible to screen readers"
"fail": "Element does not have inner text that is visible to screen readers",
"incomplete": "Unable to determine if element has children"
}
}
}
12 changes: 12 additions & 0 deletions test/checks/shared/button-has-visible-text.js
Expand Up @@ -52,4 +52,16 @@ describe('button-has-visible-text', function() {
.apply(checkContext, checkArgs)
);
});

describe('SerialVirtualNode', function() {
it('should return undefined if no other attributes are provided', function() {
var node = new axe.SerialVirtualNode({
nodeName: 'button'
});

assert.isUndefined(
axe.testUtils.getCheckEvaluate('has-visible-text')(null, {}, node)
);
});
});
});

0 comments on commit efa0e56

Please sign in to comment.