@testing-library/react: "^10.4.5",@testing-library/user-event: "^12.1.10",Problem description:
import userEvent from '@testing-library/user-event';
import { render, screen } from '@testing-library/react';
it('textarea input', () => {
render(<textarea />);
userEvent.type(screen.getByRole('textbox'), 'Hello, World!');
expect(screen.getByRole('textbox')).toHaveValue('Hello, World!');
}
Expected the element to have value:
Hello, World!
Received:
ello, World!H
For some reason, the first input symbol goes to the end of the string.
I suspect this is a duplicate of #402 caused by an outdated version of jsdom. You can fix this by using Create React App 4 or jest-environment-jsdom-sixteen. If you're still having issues, please post a reproduction with a failing sandbox or project with a package lock file.
Most helpful comment
I suspect this is a duplicate of #402 caused by an outdated version of jsdom. You can fix this by using Create React App 4 or jest-environment-jsdom-sixteen. If you're still having issues, please post a reproduction with a failing sandbox or project with a package lock file.