Flaky Tests with user.type (missing characters)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript, react, typescript
- 領域
- frontend, testing-qa
調査の方向性
提供されている DialogWithInput の再現コードと user.type の呼び出しから始め、記載されている React Testing Library、Vitest、jsdom のバージョンを使用します。文字が欠落する失敗を再現し、{ delay: null } の回避策と比較して、完全な why-won't-you-type-this? の値が確実に入力されることを、特に CI に近い条件下で検証します。
索引モデルが issue の本文から書いたものです。
説明
@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.
- 主要言語
- 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 が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug: calling configure() without reactStrictMode resets it to undefined, silently disabling strict mode再び着手できるかも @suhailopensource が 73 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 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 が 299 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
testing-library/react-testing-library#1430 · コメント 1 件 ·
-
`fireEvent.mouseEnter` does not forward `relatedTarget` (relatedTarget is the window instead)対応中かも @swarnim02 が 316 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
testing-library/react-testing-library の issue をすべて見る
似ている issue
-
bug user-priority/P2
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
bug confirmed perf
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
videojs/video.js#9400 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rescript-lang/rescript#8765 ·
メンテナーはふだん 1 日以内に返信
-
feedback simulation workshop
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
githubnext/gh-aw-workshop#4417 ·
メンテナーはふだん 1 日以内に返信