You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
SVGs should render data- attributes, according to spec (see also). SVGIcon (and therefore all other DS Icons), will not render these attributes.
There are bugs in Testing Library such that getByRole queries on images that are aria-hidden will not work with the name option (accessible name, referencing the SVG's title content), so using a data-testid attribute is the best fallback (the only one that works without resorting to plain CSS queries). Reference bug report
To Reproduce
Steps to reproduce the behavior:
Import any Icon or use the SVGIcon component with any valid SVG content
Pass in a data-testid prop. This is not flagged by TS, because it's valid
View the rendered SVG, which will have no data-testid attribute
Try with any basic HTML Element in JSX, such as a div
data-testid is rendered (as is any data- attribute)
Expected behavior data- attributes are rendered
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [OSX 12.4]
Browser [Chrome]
Version [latest]
Smartphone (please complete the following information):
N/A
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
SVGs should render
data-
attributes, according to spec (see also).SVGIcon
(and therefore all other DSIcon
s), will not render these attributes.There are bugs in Testing Library such that
getByRole
queries on images that arearia-hidden
will not work with thename
option (accessible name, referencing the SVG'stitle
content), so using adata-testid
attribute is the best fallback (the only one that works without resorting to plain CSS queries). Reference bug reportTo Reproduce
Steps to reproduce the behavior:
Icon
or use theSVGIcon
component with any valid SVG contentdata-testid
prop. This is not flagged by TS, because it's validdata-testid
attributediv
data-testid
is rendered (as is anydata-
attribute)Expected behavior
data-
attributes are renderedScreenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
N/A
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: