ix
ix copied to clipboard
Unable to test iX component using React Testing Library and Jest
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.
What happened?
UI testing of iX components is not working with React Testing Library and Jest.
For example, testing text displayed by IxContentHeader
did not work and produces following error:
TestingLibraryElementError: Unable to find an element with the text:
After following instructions in code to produce this issue, you can see that:
- Test case on text displayed with
IxContentHeader
is failed - Test case on text displayed with
IxTypography
is passed
What type of frontend framework are you seeing the problem on?
React
Which version of iX do you use?
v2.2.1
Code to produce this issue.
- Clone https://github.com/umar-shabbir/ix-issue-1288
- Run
npm install
- Run
npm test