Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fixes #37752 - Update to Patternfly 5 #11120

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MariaAga
Copy link
Contributor

@MariaAga MariaAga commented Aug 27, 2024

Updating pf4 to pf5
some work is done by running npx @patternfly/pf-codemods@latest webpack --fix

search& replace "pf-c-" to "pf-v5-c-"

Check all "onChange={[^(]" to make sure that pure pf5 are using the right arguments, as they changed order, and most onChange are onChange(event,value) and not onChange(value)

And adding act wrapper around tests.
To test this pr you will need the foreman core pf5 pr, foreman js pr, link foreman-js, and to remove any foreman-js/patternfly folder in the katello node_modules (as this breaks React shared context in tests).

This is a WIP since the other prs were just done and not polished, and also because some of the tests I had troubles fixing and dont have capacity currently to fix. These tests fail with Error: Uncaught [Error: Warning: An update to %s inside a test was not wrapped in act(...) even if every line in the test is wrapped in act, or

 Error: Error: Nock: No match for request {
      "method": "GET",
      "url": "http://localhost/api/v2/hosts/1/subscriptions/available_release_versions",
      ...

@MariaAga
Copy link
Contributor Author

MariaAga commented Sep 6, 2024

Fixed more tests but not sure what to do about the last 8 failing with this type of error as in some of them I do see the request being mocked in the test

    Error: Error: Nock: No match for request {
      "method": "GET",
      "url": "http://localhost/api/hosts/test-host",
      "headers": {
        "accept": "application/json, text/plain, */*",
        "x-requested-with": "XMLHttpRequest",
        "x-csrf-token": "",
        "referer": "http://localhost/",
        "user-agent": "Mozilla/5.0 (linux) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/11.12.0",
        "accept-language": "en",
        "host": "localhost",
        "accept-encoding": "gzip, deflate"
      }
    }

@MariaAga MariaAga changed the title [WIP] pf5 [WIP] Fixes #37752 - Update to Patternfly 5 Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant