79750792

Date: 2025-08-29 21:33:24
Score: 4
Natty:
Report link

You should avoid testing mocks with React Testing Library. The philosophy of RTL is to test your components the way users interact with them, not to verify implementation details like mock call counts. Now I think this code is highly problematic for a few reasons. Firstly, the act as you said is unnecessary for fireEvent - React Testing Library automatically wraps fireEvent in act. Async beforeEach can cause timing issues with test isolation - why do you click buttons in the beforeEach?

Reasons:
  • No code block (0.5):
  • Ends in question mark (2):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Evan