Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues Addressed
The following three related issues were worked on, enabling incremental development using TDD:
#244: Accept decimal values with dot or comma in the weight field.
#200: Prevent zero (0) as a valid weight input.
#242: Fix incorrect error message shown in the weight field.
Implemented Features
Support for decimal input using . or , in the weight field.
Validation to reject zero as an invalid weight.
Correct and specific error messages for invalid weight entries.
TDD Cycles Summary
Cycle 1 (#242):
Test created to validate proper error message "Enter correct weight".
Code adjusted to show the correct message.
Cycle 2 (#200):
Test added to ensure 0 is rejected as input.
Validation added to block values ≤ 0 and return a proper error message.
Cycle 3 (#200):
Test created to check for a specific error message when input is 0.
Code updated to show a custom message for zero.
Cycle 4 (#244):
Test implemented to allow inputs like 70.5 or 70,5.
Support for both comma and dot decimals was added and validated.