Skip to content

Commit b71fcd8

Browse files
authored
feat(alt-text): query AMP-IMG by alt text, too
For my customer, I have to implement <amp-img /> in React. I would love to be able to use the existing RTL tooling.
1 parent b28586e commit b71fcd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/queries/alt-text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const queryAllByAltText: AllByBoundAttribute = (
1212
const matcher = exact ? matches : fuzzyMatches
1313
const matchNormalizer = makeNormalizer({collapseWhitespace, trim, normalizer})
1414
return Array.from(
15-
container.querySelectorAll<HTMLElement>('img,input,area'),
15+
container.querySelectorAll<HTMLElement>('img,input,area,amp-img'),
1616
).filter(node =>
1717
matcher(node.getAttribute('alt'), node, alt, matchNormalizer),
1818
)

0 commit comments

Comments
 (0)