ucsb-cs156 / proj-happycows

https://ucsb-cs156.github.io/proj-happycows/
0 stars 0 forks source link

BUG: Disallow selling negative cow amounts #93

Closed sangitakunapuli closed 4 months ago

sangitakunapuli commented 6 months ago

Have you updated the title?

Summary

When inputting a value into the field, a user can input a negative value that updates the number of cows and wealth when it should not.

Expected Behavior

The user should see a popup similar to:

Screenshot 2024-02-21 at 4 34 57 PM

indicating that you should not be able to sell negative cows.

The number of cows and wealth should not be affected.

Current / Observed Behavior

Currently, you can input a negative value which allows you to sell a negative number of cows - which doesn't make sense.

Screenshot 2024-02-21 at 4 39 13 PM

The wealth and # of cows values are updated accordingly with negative values as well.

Steps to Reproduce

  1. Click sell cows. Input a negative value into the box Screenshot 2024-02-21 at 4 45 19 PM
  2. Observe how the values of # cows and wealth change incorrectly. Screenshot 2024-02-21 at 4 48 29 PM

Browser / Platform Info

Chrome on MacOS