diff --git a/__mocks__/genInteractives.js b/__mocks__/genInteractives.js index 5f8e157aa..722b6b17d 100644 --- a/__mocks__/genInteractives.js +++ b/__mocks__/genInteractives.js @@ -18,9 +18,8 @@ const interactiveElementsMap = { audio: [], button: [], canvas: [], + datalist: [], embed: [], - label: [], - link: [], input: [], 'input[type="button"]': [{ prop: 'type', value: 'button' }], 'input[type="checkbox"]': [{ prop: 'type', value: 'checkbox' }], @@ -43,6 +42,7 @@ const interactiveElementsMap = { 'input[type="time"]': [{ prop: 'type', value: 'time' }], 'input[type="url"]': [{ prop: 'type', value: 'url' }], 'input[type="week"]': [{ prop: 'type', value: 'week' }], + link: [{ prop: 'href', value: '#' }], menuitem: [], option: [], select: [], @@ -56,10 +56,12 @@ const interactiveElementsMap = { video: [], }; -const nonInteractiveElementsMap = { +const nonInteractiveElementsMap: {[string]: Array<{[string]: string}>} = { abbr: [], + aside: [], article: [], blockquote: [], + body: [], br: [], caption: [], dd: [], @@ -84,6 +86,7 @@ const nonInteractiveElementsMap = { hr: [], iframe: [], img: [], + label: [], legend: [], li: [], main: [], @@ -93,11 +96,14 @@ const nonInteractiveElementsMap = { meter: [], nav: [], ol: [], + optgroup: [], + output: [], p: [], pre: [], progress: [], ruby: [], - section: [], + 'section[aria-label]': [{ prop: 'aria-label' }], + 'section[aria-labelledby]': [{ prop: 'aria-labelledby' }], table: [], tbody: [], td: [], diff --git a/__tests__/src/rules/control-has-associated-label-test.js b/__tests__/src/rules/control-has-associated-label-test.js index 043a141f2..a8d8c414b 100644 --- a/__tests__/src/rules/control-has-associated-label-test.js +++ b/__tests__/src/rules/control-has-associated-label-test.js @@ -45,7 +45,6 @@ const alwaysValid = [ { code: '', options: [{ depth: 3, labelAttributes: ['label'] }] }, { code: 'Save' }, { code: 'Save' }, - { code: '' }, { code: 'Save' }, { code: 'Save' }, { code: '' }, @@ -139,6 +138,7 @@ const alwaysValid = [ { code: '
' }, { code: '