From 8fa0964f5fd15fabac988d5a135735e0bc481944 Mon Sep 17 00:00:00 2001 From: Steven Lambert Date: Thu, 14 Nov 2019 08:14:49 -0700 Subject: [PATCH] fix(listitem): clarify that li elements must be contained in a list or role=list (#1894) * fix(listitem): clarify that li elements must be contained in a list or role=list * add message to remediation * remove comment --- lib/checks/lists/listitem.js | 1 + lib/checks/lists/listitem.json | 2 +- test/checks/lists/listitem.js | 65 +++++++++++++++++++--------------- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/lib/checks/lists/listitem.js b/lib/checks/lists/listitem.js index a53deec328..d6fd712275 100644 --- a/lib/checks/lists/listitem.js +++ b/lib/checks/lists/listitem.js @@ -12,6 +12,7 @@ if (parentRole === 'list') { } if (parentRole && axe.commons.aria.isValidRole(parentRole)) { + this.data('roleNotValid'); return false; } diff --git a/lib/checks/lists/listitem.json b/lib/checks/lists/listitem.json index 1f7057a0aa..b1cd6fcce4 100644 --- a/lib/checks/lists/listitem.json +++ b/lib/checks/lists/listitem.json @@ -5,7 +5,7 @@ "impact": "serious", "messages": { "pass": "List item has a