Unable to getByRole figure with accessible name / description in figcaption
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript, react
- 領域
- testing
調査の方向性
まず、accessible name と description のオプションを使って、報告された figure マークアップを screen.getByRole で再現します。次に、getByRole における figure と figcaption のセマンティクスの処理を追跡し、その後、クエリが期待される accessible name または description を持つ figure を見つけることを確認します。
索引モデルが issue の本文から書いたものです。
説明
@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.
- 主要言語
- JavaScript
- スター
- 19.7k
- フォーク
- 1.2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
testing-library/react-testing-library のほかの issue
-
fireEvent.select does not wrap its automatic native focus in act対応中かも @sergioperezcheco が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug: calling configure() without reactStrictMode resets it to undefined, silently disabling strict mode再び着手できるかも @suhailopensource が 77 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
testing-library/react-testing-library#1466 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
testing-library/react-testing-library#1459 · コメント 2 件 ·
-
perf: optimize container lookup with early exit再び着手できるかも @Ch-Abhinav-Chowdary が 303 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
testing-library/react-testing-library#1430 · コメント 1 件 ·
-
`fireEvent.mouseEnter` does not forward `relatedTarget` (relatedTarget is the window instead)対応中かも @swarnim02 が 320 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
testing-library/react-testing-library の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
schmayterling/hibi#245 ·
メンテナーはふだん 1 日以内に返信
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug package:vitest
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
cloudflare/workers-sdk#16255 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Proxy and MCP URLs with an empty authority parse as a different host対応中かも @ericcaiwx-star が今日担当しました。 オープンclawsweeper:bulk-filed clawsweeper:linked-pr-open clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
openclaw/openclaw-enterprise#2384 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Access-request approve silently discards the decider's note (decision_note written only on deny)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Uuriko/project-room#3378 ·
メンテナーはふだん 1 日以内に返信