-
Notifications
You must be signed in to change notification settings - Fork 0
Week 3 Mindy & Claudia (Add a new item to shopping list)
A shopping list item consists of the following data points:
- Name of item
- How soon are you likely to buy it again?
- Soon (in the next 7 days)
- Kind of soon (between 7 and 30 days)
- Not soon (more than 30 days)
AC:
- User is presented with a form that allows them to enter/indicate the information listed above
- When the user submits the form, the item is saved to the database, associated with the user’s token
BuyFrequencyButton component was created to be returned by the AddItem component. This new component contains the three buttons which will allow user to answer how soon they plan on buying item again. Some styles were added, including changing the color scheme using this color palette. The next step will be to add the user response to the database.
Converted buttons to radio buttons within the AddItem
component, pulled out the styling into the CSS file, set up the user input connection to the database for frequency.
Last step is to add tests! What to test on...? Check for radio button html flag?
Set the initial state of the radio buttons to "pretty-soon", so one button will always be selected. Changed button cursor to pointer on hover. Wrote first test to check that radio button selection has the expected value. Wrote second test to check that the selected radio button is focused.
http://react.tips/radio-buttons-in-react-16/ https://docs.cypress.io/guides/references/assertions.html#Value https://docs.cypress.io/api/commands/focused.html#No-Args