Flaky Tests with user.type (missing characters)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, react, typescript
- Lĩnh vực
- frontend, testing-qa
Hướng nghiên cứu
Bắt đầu với bản tái hiện DialogWithInput được cung cấp và lệnh gọi user.type, sử dụng các phiên bản React Testing Library, Vitest và jsdom được liệt kê. Tái hiện lỗi thiếu ký tự, so sánh lỗi này với giải pháp tạm thời { delay: null }, và xác minh rằng giá trị đầy đủ why-won't-you-type-this? được nhập một cách ổn định, đặc biệt trong các điều kiện tương tự CI.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@testing-library/reactversion: 16.3.0- Testing Framework and version:
[email protected] - DOM Environment:
[email protected]
Relevant code or config:
import {
Dialog,
DialogBody,
DialogContent,
DialogSurface,
DialogTitle,
} from "@fluentui/react-components";
const DialogWithInput = () => {
return (
<Dialog open={true}>
<DialogSurface>
<DialogBody>
<DialogTitle>Flaky RTL Test MWE</DialogTitle>
<DialogContent>
<input type="text" />
</DialogContent>
</DialogBody>
</DialogSurface>
</Dialog>
);
}
describe("DialogWithInput", () => {
it("accepts long text", async () => {
const user = userEvent.setup();
render(<DialogWithInput />);
const textbox = await screen.findByRole("textbox");
await user.type(textbox, "why-won't-you-type-this?");
await waitFor(async () =>
expect(textbox).toHaveValue("why-won't-you-type-this?")
);
});
});
What you did:
I tested whether a user could correctly modify a textbox using await user.type(<textbox>, <text-value>). The textbox is embedded inside a simple Fluent UI v9 Dialog component.
What happened:
user.type did not type the full text-value leading to a test failure:
Expected the element to have value:
why-won't-you-type-this?
Received:
why-wo
Reproduction:
Repo: https://github.com/[mzietlow/flaky-rtl-tests
Stackblitz (although I did not try it on stackblitz): https://stackblitz.com/github/mzietlow/flaky-rtl-tests
Problem description:
Tests are flaky. Especially on CI, where user.type tends to produce even fewer characters.
Suggested solution:
user.type should type all characters.
I was able to pass { delay: null } as a temporary workaround, but that is not really a solution.
- 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 315 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ự
-
Remove: Fox Deportes SDĐang mởcheck:passed feeds:remove
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
iptv-org/database#37176 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
hawk-digital-environments/HAWKI#443 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
modelcontextprotocol/python-sdk#3662 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feedback simulation workshop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
githubnext/gh-aw-workshop#4370 ·
Maintainer thường phản hồi trong vòng 1 ngày