Potential A11y Violation:
Incorrect banner element parent
Point of Failure
An element with the role of banner
should only be a direct descendant of the body element.
Available Automation Evaluation
In checking known available linting and testing tools, these are our findings.
Linting Cannot Exist
Does not exist yet. It could, though. A check could be done for elements with the role of banner, and then a check could be done to see if that element is a direct descendant of the body element (or similar).
If you have any ideas about how this could be done, please file an issue on this app's GitHub Repository.
Testing Exists
See the axe-core
library for the landmark-banner-is-top-level
rule.
Other Test Methods
In addition to automated tests, there are other types of tests that could be conducted to prevent this potential violation.
Developer Authored Test Could Exist
Developers should ensure that their code does not violate this rule, and, if possible, write a test that prevents regressions in code if it is later changed.
Manual Test Exists
Review page and ensure the point of failure does not exist, inspecting the DOM where required.