Description
Over the time, certain patterns have evolved that help us unit test the frontend components. Two examples are the flushPromises function or the runLastEffect mock for react. Right now, every test file that uses those helpers provides their own implementation.
This results in a lot of duplicated code in the test files. We should instead provide a central implementation of those helper functions.