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

Fix test warning on test library wrap in act #556

Closed
wants to merge 8 commits into from

Conversation

JeffGreiner-eaton
Copy link
Collaborator

@JeffGreiner-eaton JeffGreiner-eaton commented Mar 4, 2024

Fixes # #390.

Changes proposed in this Pull Request:

  • wrap fireEvents in act()
  • Note: render, fireEvent & userEvent... are already wrapped in act() from react test library and not 100% sure why this warning displays

Screenshots / Screen Recording (if applicable)

To Test:

Any specific feedback you are looking for?

  • I created a new test file to single out 1 test that has the updated act in the test. The test passes and has no console warning. I'm out of ideas on how to remedy the lint warnings in this file configured in different ways other than doing some eslint-ignores everywhere...

  • warning: Async arrow function has no 'await' expression
    If you add the await then it complains about that

  • warning: Unexpected await of a non-Promise (non-"Thenable") value
    If you remove the async function and the await and only wrap the fireEvent with act()
    image

  • warning: An update to RegistrationWorkflow inside a test was not wrapped in act(...)

  • I update the temporary test file with void ((): void => on line 54. If you would want to see the combination of lint warnings please remove line 54

I'm uncertain if the renderer render if causing all this.

Unrelated to this PR, the base component tests are setup the same with the renderer and all those tests throw warnings on i18Next.

  • console.warn
    react-i18next:: You will need to pass in an i18next instance by using initReactI18next

@github-actions github-actions bot added the brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering label Mar 4, 2024
Copy link

github-actions bot commented Mar 4, 2024

Visit the preview URL for this PR (updated for commit cb48c50):

https://blui-react-login--pr556-fix-blui-5380-test-w-ncsmiw8a.web.app

(expires Fri, 08 Mar 2024 18:05:30 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1e9064d2e35ed37fe01e053587ea5f209719a043

@JeffGreiner-eaton
Copy link
Collaborator Author

I've seen this done in other files but not certain. void ((): void =>

image

Copy link
Collaborator

@surajeaton surajeaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix lint and prettier.
We may need to add husky in this repo.

@JeffGreiner-eaton
Copy link
Collaborator Author

Please fix lint and prettier. We may need to add husky in this repo.

yes I know it has lint warnings, did you read the Any specific feedback you are looking for section above

@JeffGreiner-eaton JeffGreiner-eaton deleted the fix/blui-5380-test-warning-act branch March 6, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering
Development

Successfully merging this pull request may close these issues.

2 participants