Skip to content

Commit 9925c39

Browse files
authored
docs: fix incorrect description of getByAltText (#1194)
1 parent 7a82802 commit 9925c39

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/queries/byrole.mdx

+4-5
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ oftentimes better to use `getByRole(expectedRole, { name: 'The name' })`. The
6262
accessible name query does not replace other queries such as `*ByAlt` or
6363
`*ByTitle`. While the accessible name can be equal to these attributes, it does
6464
not replace the functionality of these attributes. For example
65-
`<img aria-label="fancy image" src="fancy.jpg" />` will be returned for both
66-
`getByAltText('fancy image')` and `getByRole('img', { name: 'fancy image' })`.
67-
However, the image will not display its description if `fancy.jpg` could not be
68-
loaded. Whether you want to assert this functionality in your test or not is up
69-
to you.
65+
`<img aria-label="fancy image" src="fancy.jpg" />` will be returned for
66+
`getByRole('img', { name: 'fancy image' })`. However, the image will not display
67+
its description if `fancy.jpg` could not be loaded. Whether you want to assert
68+
this functionality in your test or not is up to you.
7069

7170
## Options
7271

0 commit comments

Comments
 (0)