From efa0e56ed8901c0d379e564cc0d4d5532b5df547 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Thu, 9 Jul 2020 08:54:54 -0600 Subject: [PATCH] fix(button-name): work with serial virtual node (#2351) --- lib/checks/shared/button-has-visible-text.json | 3 ++- test/checks/shared/button-has-visible-text.js | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/checks/shared/button-has-visible-text.json b/lib/checks/shared/button-has-visible-text.json index e28465f5f3..74173071da 100644 --- a/lib/checks/shared/button-has-visible-text.json +++ b/lib/checks/shared/button-has-visible-text.json @@ -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" } } } diff --git a/test/checks/shared/button-has-visible-text.js b/test/checks/shared/button-has-visible-text.js index 042832d40a..9c64c249fe 100644 --- a/test/checks/shared/button-has-visible-text.js +++ b/test/checks/shared/button-has-visible-text.js @@ -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) + ); + }); + }); });