Skip to content

Week 3 Mindy & Claudia (Add a new item to shopping list)

Mindy Zwanziger edited this page Nov 30, 2019 · 1 revision

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

11/25

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.

11/27

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?

11/29

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.

Resources

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

Clone this wiki locally