Unable to getByRole figure with accessible name / description in figcaption
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, react
- Ambito
- testing
Direzione di ricerca
Inizia riproducendo il markup di figure segnalato con screen.getByRole usando le opzioni accessible name e description. Segui quindi la gestione della semantica di figure e figcaption da parte di getByRole, poi verifica che la query trovi il figure con l’accessible name o la description prevista.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
@testing-library/reactversion: 16.3.0- Testing Framework and version: jest 30.0.5
- DOM Environment: jest-environment-jsdom 30.0.5
Relevant code or config:
<figure>
<figcaption>Foo</figcaption>
<ul>
<li>Bar</li>
</ul>
</figure>
What you did:
What trying to get hold of the figure element using:
const figure = screen.getByRole("figure", { name: "Foo" });
or
const figure = screen.getByRole("figure", { description: "Foo" });
or
const figure = screen.getByRole("figure", { name: /Foo/ });
or
const figure = screen.getByRole("figure", { description: /Foo/ });
What happened:
ShadowDOMTestingLibraryElementError: Unable to find an element with the role of: figure
Reproduction:
Problem description:
Unable to get figure using accessible name / description in figcaption
As per:
https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/
Like with table elements, if a figure is not named using aria-label or aria-labelledby, the content of the figcaption element will be used as the accessible name. However unlike table elements, if the figcaption element is not used for the name, it does not become an accessible description unless it is referenced by aria-describedby. Nevertheless, assistive technologies will render the content of a figcaption regardless of whether it is used as a name, description, or neither.
- Lingua principale
- JavaScript
- Stelle
- 19.7k
- Fork
- 1.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di testing-library/react-testing-library
-
fireEvent.select does not wrap its automatic native focus in actForse già presa @sergioperezcheco l’ha presa 6 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
bug: calling configure() without reactStrictMode resets it to undefined, silently disabling strict modeForse di nuovo libera @suhailopensource l’ha presa 76 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
testing-library/react-testing-library#1466 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
testing-library/react-testing-library#1459 · 2 commenti ·
-
perf: optimize container lookup with early exitForse di nuovo libera @Ch-Abhinav-Chowdary l’ha presa 302 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
testing-library/react-testing-library#1430 · 1 commento ·
-
`fireEvent.mouseEnter` does not forward `relatedTarget` (relatedTarget is the window instead)Forse già presa @swarnim02 l’ha presa 320 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Tutte le issue di testing-library/react-testing-library
Issue simili
-
area: docs good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Support
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openseadragon/openseadragon#2996 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jfromaniello/url-join#134 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100