Testing the CreatePost component
Follow step-by-step instructions to write test cases for the CreatePost component.
We'll cover the following...
We'll cover the following...
In the src/components/posts/__tests__ directory, create a new file called CreatePost.test.js. We’ll start with the necessary imports and the definition of the test function:
We can notice the introduction of the async keyword before the callback function. To create a post, the user performs typing operations on text inputs and finally clicks a button to submit the post. These actions are asynchronous. The functions, ...