Uploaded image for project: 'OpenShift Dev Console'
  1. OpenShift Dev Console
  2. ODC-6264

Improve react-testing-library user-event extension usability (with PatternFly)

    XMLWordPrintable

Details

    • Story
    • Resolution: Unresolved
    • Normal
    • openshift-4.13
    • None
    • UI
    • 1
    • False
    • False
    • 0
    • undefined
    • Not Supported
    • ODC Sprint 218, ODC Sprint 227, ODC Sprint 228, ODC Sprint 229, ODC Sprint 230

    Description

      Description of problem:

      With ODC-5851 we introduced react-testing-library (or the "testing-library") to our code.

      We also added the official "user-event" extension (https://testing-library.com/docs/ecosystem-user-event/) which provides additional functions to simulate browser events. For example it can simulate that a user types a text into an input field (focus, multiple key events, blur event and change event) instead of just firing one single onChange event.

      This is really useful but it doesn't work well with our InputFields from @console/shared and TextInput from PatternFly.

      Actual results:

      userEvent.type(inputField) fails

      Expected results:

      userEvent.type(inputField) should work

      Additional notes

      As part of this PR the workaround in packages/dev-console/src/components/buildconfig/_tests_/user-event.ts should be removed and replaced with the @testing-library/user-event library.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cjerolim Christoph Jerolimov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: