Closed lemadmax closed 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!
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.
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.
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.
@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]
Codecov Report
100.00% <100.00%> (ø)
Continue to review full report at Codecov.