logRoles does not print hidden elements
@naorpeled đang làm issue này rồi.
Từ ngày 18/6/2023.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu từ các entry point logRoles và logRole, đặc biệt là chữ ký TypeScript được đề cập trong issue, và tái hiện output rỗng với các phần tử bị ẩn. So sánh output của role với screen.debug; được xem là hoàn tất khi các phần tử bị ẩn được bao gồm như yêu cầu, tham số thứ hai được chấp nhận và output liên quan phân biệt các phần tử bị ẩn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@testing-library/reactversion: 14.0.0- Testing Framework and version: Jest 29.4.3
- DOM Environment: jsdom 29.4.3
Relevant code or config:
const buttons = await waitFor(
screen.getAllByRole("button", { hidden: true })
);
logRoles(buttons)
What you did:
I was trying to logRoles for a DOM tree with hidden elements. Failed to see the elements show in the roles list.
What happened:
Logging roles for hidden elements produces an empty log.
Reproduction:
- Get all elements of a DOM tree including hidden ones. Make sure you have hidden ones.
- Log using
logRoles - See that some log entries are empty compared to what you see when you
screen.debug
Problem description:
If you log an element you found using { hidden: true }, logRoles will not print it. Similarly won't print hidden elements in a DOM tree you pass in. This is the opposite of what I would expect from this tool. I want to know why something may be failing to query, so I want to see everything in the tree.
The logRole function does take a { hidden } parameter and by default is set to false, however the function signature in Typescript does not accept a second parameter.
Suggested solution:
A useful thing would be that hidden was on by default, the function signature would be updated to take the second parameter, and that elements logged that are hidden, report so in the pretty role output.
- Ngôn ngữ chính
- JavaScript
- Star
- 19.7k
- Fork
- 1.2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testing-library/react-testing-library
-
fireEvent.select does not wrap its automatic native focus in actCó thể đã có người làm @sergioperezcheco đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug: calling configure() without reactStrictMode resets it to undefined, silently disabling strict modeCó thể làm lại được @suhailopensource đã nhận 72 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
testing-library/react-testing-library#1466 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
testing-library/react-testing-library#1459 · 2 bình luận ·
-
perf: optimize container lookup with early exitCó thể làm lại được @Ch-Abhinav-Chowdary đã nhận 298 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 35/100
testing-library/react-testing-library#1430 · 1 bình luận ·
-
`fireEvent.mouseEnter` does not forward `relatedTarget` (relatedTarget is the window instead)Có thể đã có người làm @swarnim02 đã nhận 316 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Tất cả issue của testing-library/react-testing-library
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
processing/p5.sound.js#123 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
PhilflowIO/dav-mcp#146 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a light/dark theme toggleĐang mởgood first issue hacktoberfest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Tanishq964/trail-kit.#4 ·
-
Request: <brand-name>Đang mởnew icon permissions in review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
simple-icons/simple-icons#15067 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
mastra-ai/mastra#26562 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày