3 hours looking for a bug... The bug? a wrong name...
Chris
Saturday, July 8, 2023 at 07:26:59
The problem was simple. I had two mocks. ModalNotification and ModalConfirmation. The fact is that I had done a requireActual and I was wrong, I thought I had done this for both and the fact is that I had done this twice for the ModalConfirmation. So the ModalNotification implementation was a simple mock that didn't return any elements. The thing is that since I'm learning jest and testing library and mocks and all this, I thought it was a problem with the modals in testing library and jest. I searched for everything, not suspecting that there was such a naive mistake... In the end, removing the mocks and leaving the real implementation, I was able to realize the error. Lesson learned? Sleep well, rest, clear your head, stop when you have to stop, eat when you have to eat, etc. Because I was very exhausted, I hadn't slept well for several days, without resting, just scheduling, and that day I hadn't had lunch and it was 6 in the afternoon; And when you take yourself to such a level of stress as I was, you create these errors yourself and you yourself are unable to see them. It seems to me that it is a way of your unconscious to communicate its annoyance for neglecting you.
1 Likes