2022-Spring-NYU-DevOps-Shopcarts / shopcarts

Shopcarts squad.
Apache License 2.0
2 stars 2 forks source link

UI for update item #131

Closed lemadmax closed 2 years ago

codecov-commenter commented 2 years ago

Codecov Report

Merging #131 (27e07b1) into main (083fc1d) will decrease coverage by 0.00%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #131      +/-   ##
==========================================
- Coverage   99.11%   99.11%   -0.01%     
==========================================
  Files           7        7              
  Lines         453      452       -1     
==========================================
- Hits          449      448       -1     
  Misses          4        4              
Impacted Files Coverage Δ
service/routes.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 083fc1d...27e07b1. Read the comment docs.

TimothyXu commented 2 years ago

I have made a new commit to add in further BDD tests since I realised currently this feature is not working as intended, despite passing all the BDD tests we had. In update_items, we have the ability to only pass in price or only pass in quantity and they should still work to update the item in question. Currently if we leave the price or quantity field empty we get an error. Just need to sort that out (make the new BDD tests pass) please!

TimothyXu commented 2 years ago

also, for BDD tests if you need to adjust something (you probably will), please make sure you check for status message confirmation before checking for results in tables. Otherwise they may fail on deployment since our real website has much worse latency than localhost.

TimothyXu commented 2 years ago

I did mean to write quantity = 0 in that test. This should not be accepted, and in the back end implementation this is correctly not accepted. I don't know the JS functions so I don't know how to do this. On the other hand price = 0 is allowed and currently this works. Need to fix the quantity = 0 test.

Separately, unfortunately I discovered another issue (that also affects many other buttons, I will alert others). When we enter a non-int user_id or a non-int item_id into the UI and press update items, we get no error message and no effect at all, even though the back end is sending the error message. Don't know why these error messages are not getting passed on.

TimothyXu commented 2 years ago

Apart from the global issue we have with inputting non-numbers into User ID and Item IDs, this feature is complete so I will merge this as soon as the CI tests pass.

TimothyXu commented 2 years ago

@lemadmax I'm afraid there are more logical bugs. 2 tests fail: when trying to update with quantity "quantity" and price "2.5", we should get the error message "invalid quantity" but right now we actually get a success and updates the price without touching the quantity. [EDIT: actually we don't need to worry about this after the HTML fix. I will update the tests right now]