In this challenge, you will have to create an application to train what you have learned so far in ReactJS This will be an application where your main objective is a small application of activities to do, to train a little more about state manipulation in React.
- Add a new task: It must be possible to add a new task in the task state, with the fields id which must be generated randomly, title which must be text and isComplete which must start as false.
- Remove a task: You must receive an ID by parameter and remove the task that contains that ID from the state.
- Mark and unmark a task as completed: You must change the status of isComplete for a task with a specific ID that is received by parameter.
For this challenge, we have the following tests:
-
should be able to add a task: In order for this test to pass, you must allow the task to be created and thus displayed on the screen. The created taks must contain the attributes following the standard of the interface.
-
should not be able to add a task with an empty title: For this test to pass, before creating a new task, you must validate that something was typed in the input and do not allow the creation of the task if the value be empty, if the value entered is empty, you must prevent the creation of the task.
-
should be able to remove the task: In order for this test to pass, you must allow that when clicking on the button with a trash icon, the task related to that button is removed from the state of the application, consequently being removed from the screen.
-
should be able to check a task: For this test to pass, you must allow that when clicking on the checkbox next to the task, it is marked as completed or not completed according to its current state, changing its value from
isCompletetofalsetotrueor conversely, fromtruetofalse.
This project is under a license MIT.
Challenge proposed with π by Rocketseat π Join this great community!
