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

Eula screen tests throws console warnings to wrap #390

Closed
JeffGreiner-eaton opened this issue Aug 4, 2023 · 2 comments · Fixed by #558
Closed

Eula screen tests throws console warnings to wrap #390

JeffGreiner-eaton opened this issue Aug 4, 2023 · 2 comments · Fixed by #558
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering bug Something not working as expected
Milestone

Comments

@JeffGreiner-eaton
Copy link
Collaborator

JeffGreiner-eaton commented Aug 4, 2023

Describe the bug / expected behavior

While running should call onNext, when Next button clicked test this warning displays in console.

Warning: An update to EulaScreen inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

Several attempts of using await act() or just act() at step fireEvent.click(nextButton) does not clear up the warning.

act(() => {
            fireEvent.click(nextButton);
        })

What are the steps to reproduce?

  1. Go to EulaScreen.test and run should call onNext, when Next button clicked test
  2. Observe the warning

Screenshots / Screen recording

Code snippet / Link to minimum reproduction example

CODE HERE

Your environment information

Suggested fix

Anything else to add?

https://kentcdodds.com/blog/fix-the-not-wrapped-in-act-warning

@JeffGreiner-eaton JeffGreiner-eaton added bug Something not working as expected needs-review Issues that we would like to revisit/review brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering labels Aug 4, 2023
@ektaghag-eaton ektaghag-eaton removed the needs-review Issues that we would like to revisit/review label Aug 17, 2023
@ektaghag-eaton
Copy link
Contributor

A possible fix is to divide the current test case into 2 or focus only on the Next button functionality.

@ektaghag-eaton
Copy link
Contributor

BLUI-4661

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 bug Something not working as expected
Development

Successfully merging a pull request may close this issue.

3 participants