After updating version from "10.1.0" to "13.5.0" getting error
See original GitHub issue@testing-library/user-eventversion: “13.5.0”
-
Testing Framework and version: “jest”: “^27.2.5”, “@testing-library/dom”: “^8.9.1”, “@testing-library/jest-dom”: “^5.14.1”, “@testing-library/react”: “^12.1.2”, “@testing-library/user-event”: “^13.5.0”
Relevant code or config
`longQueryText is more than 5000 characters.
const errorText =
'The size is too big. Please reduce your string.';
const { getByTestId, getByText, queryByText } = render(
<Test/>
);
expect(queryByText(errorText)).not.toBeInTheDocument();
const searchInput = getByTestId('test');
userEvent.type(searchInput, longQueryText);
expect(getByText(errorText)).toBeInTheDocument();
});
What you did:
What happened: Test is failing and getting this error
TestingLibraryElementError: Unable to find an element with the text: The query size is too big. Please reduce your string.. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, <script />, <style />
Reproduction repository:
Note: It is passing till 11.4.2 but the issue is happening from version 13.0.0.
Problem description:
Suggested solution:
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)

Top Related StackOverflow Question
@ph-fritsche fyi, I transferred this issue back to user-event.
@Sushmasrig The problem is that
typetakes too long and thus the error message isn’t show yet. As a work around you can useuserEvent.paste.Thanks for clearing that up. Yes,
typeis not meant to be used for thousands of characters. As there usually is nothing to be gained from simulating that amount of typing, we won’t do anything about it.