ix icon indicating copy to clipboard operation
ix copied to clipboard

Unable to test iX component using React Testing Library and Jest

Open umar-shabbir opened this issue 9 months ago • 1 comments

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

image

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.

  1. Clone https://github.com/umar-shabbir/ix-issue-1288
  2. Run npm install
  3. Run npm test

umar-shabbir avatar May 21 '24 19:05 umar-shabbir