gagataiga / Phone-Review-App

legacy project
MIT License
1 stars 1 forks source link

Express: Make Tests for Input #8

Closed gagataiga closed 1 year ago

gagataiga commented 1 year ago

Write some tests to check that the input values are legitimate before adding them to the database (i.e., check that the Email input is actually an email address instead of random letters).

All of the fields should be filled in before submission (no leaving Nickname empty, for example).

kappanjoe commented 1 year ago

From previous team's comments:

Hints for email, check codewars similar exercise: https://www.codewars.com/kata/514a024011ea4fb54200004b

// Self suggestion // Add an alert window to confirm user choice / alert user with error on screen

Add checks within the /api/review post endpoint. These test should

if review is invalid, return falsey statement