Jerkinator / SecondRollFrontend

0 stars 0 forks source link

Rating system based on username, finished function. #50

Closed TeisLoyche closed 6 months ago

TeisLoyche commented 6 months ago

Alright, this one needed a little work in both back- and frontend. I had to change our rating-system in backend so that it's based on username and not user ID. So here's how to test it:

BACKEND

  1. First, open up our backend-project in IntelliJ.
  2. Open up a terminal in IntelliJ and do a git fetch.
  3. Now do: git checkout testing-rating-with-username
  4. Run the server.

FRONTEND

  1. Open up our frontend project in VScode.
  2. Open up a terminal and do git fetch.
  3. Now do: git checkout 31-create-rating-component
  4. Run the program and log in to a user. OBS: Make sure that you clear your storage first, and make sure you do not log into a user that is an admin!
  5. Now go to http://localhost:5173/rateuser
  6. Enter the username of a DIFFERENT user than you are logged in to. (You can try giving yourself a rating aswell for fun, should get an error message.)
  7. Enter a rating from 1-6 (You can try entering a rating below or above aswell, should get an error message).
  8. Hit "Ge betyg". The console says dispatch error for now, but the rating should go through.

To double check that the rating went through, go to our MongoDB Cloud and check the chosen user's "ratings"-array. If your rating is there: success!