You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky Tests with user.type (missing characters) #1419
import{Dialog,DialogBody,DialogContent,DialogSurface,DialogTitle,}from"@fluentui/react-components";constDialogWithInput=()=>{return(<Dialogopen={true}><DialogSurface><DialogBody><DialogTitle>FlakyRTLTestMWE</DialogTitle><DialogContent><inputtype="text"/></DialogContent></DialogBody></DialogSurface></Dialog>);}describe("DialogWithInput",()=>{it("accepts long text",async()=>{constuser=userEvent.setup();render(<DialogWithInput/>);consttextbox=awaitscreen.findByRole("textbox");awaituser.type(textbox,"why-won't-you-type-this?");awaitwaitFor(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
Hi @MatanBobi, thanks for checking. I noticed you used happy-dom in your reproduction, while we’re running tests with jsdom. I tried with happy-dom as well and couldn’t reproduce the issue with it. However, I was able to reproduce it on my private machine (other than my machine at work) inside WSL2 with jsdom by increasing the input length, for example:
Activity
[-]Flaky Tests with userEvent.type (missing characters)[/-][+]Flaky Tests with user.type (missing characters)[/+]MatanBobi commentedon Oct 7, 2025
Hi @mzietlow, thanks for opening this.
I actually tried to reproduce it on our reproduction repo and looks like the test is passing, might be something related to other dependencies you have?
https://stackblitz.com/edit/rtl-template-xtnzzhex?file=src%2FDialogWithInput.test.tsx
malte-dallmeyer commentedon Oct 7, 2025
Hi @MatanBobi, thanks for checking. I noticed you used
happy-domin your reproduction, while we’re running tests withjsdom. I tried withhappy-domas well and couldn’t reproduce the issue with it. However, I was able to reproduce it on my private machine (other than my machine at work) insideWSL2withjsdomby increasing the input length, for example:Could you try running it with
jsdom?beanscg commentedon Jun 9, 2026