Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Flaky Tests with user.type (missing characters)

オープン
#1,419 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
javascript, react, typescript

調査の方向性

提供されている DialogWithInput の再現コードと user.type の呼び出しから始め、記載されている React Testing Library、Vitest、jsdom のバージョンを使用します。文字が欠落する失敗を再現し、{ delay: null } の回避策と比較して、完全な why-won't-you-type-this? の値が確実に入力されることを、特に CI に近い条件下で検証します。

索引モデルが issue の本文から書いたものです。

説明

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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testing-library/react-testing-library のほかの issue

testing-library/react-testing-library の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。