Description
When using getByRole
, represent non-breaking whitespace in failure output as
, so that it's easier to diagnose the distinguish between " "
and
. This would be in the list below "here are the accessible roles" under the "name" output.
Motivation: Non-breaking whitespace is not collapsed into " "
in the accname calculation. This is correct according to the ARIA spec, but is tricky to debug getByRole
failures related to usage of non-breaking whitespace. See also #904
Alternatives considered
We considered a custom helper to automatically collapse whitespace, but that is harder to maintain and discover than having the behavior in the core library. Further, it does not actually represent end-user experience since the browser does not perform this collapsing automatically.