OpenNutriTracker
OpenNutriTracker copied to clipboard
Tests for the UnitDropdownItem
I added tests for the fromString method of the UnitDropdownItem enum. These tests ensure that the conversion from a string to the enum works correctly, covering different scenarios such as valid inputs, format variations (e.g., 'fl oz' and 'fl.oz'), and invalid inputs, ensuring that it correctly returns the default value (g/ml) in those cases. This implementation directly contributes to increasing test coverage and improving the overall quality and robustness of the project.