bbc/bbc-a11y

The 'hide' option does not hide warnings

jennyrobertsonbbc opened this issue · 3 comments

Summary

The 'hide' option does not hide warnings, it only hides failures.

Expected Behaviour

Having something in the 'hide' options would also hide the warnings.

Current Behaviour

'bbccookies-prompt' is in my hide options, but the warning

⚠ Structure: Headings: Headings must be in ascending order - First heading was not a main heading: //div[@id='bbcprivacy-prompt']/h2
is still appearing in my output on the command line.

Possible Solution

Make the addWarning function similar to the addError function:

if (this.hide) {

Steps to Reproduce (for bugs)

  1. Find a warning that is being output BBC a11y and add it to your hide options
  2. Observe that the warning still appears.

Context & Motivation

It will make developers think there is an issue that may need fixing, when actually we don't have control over certain elements, and have hidden them from the a11y tool.

Agree it should be possible to hide warnings as well as errors, especially for code that the team have no control over.

However, the specific issue around heading hierarchy is also covered by #284

I would like to work on this issue today :)

A fix for this has now been merged :)