matcha-devs / matcha

A comprehensive web-based personal finance tracker and budgeting tool.
6 stars 0 forks source link

14 maximize coverage of mysqlgo #29

Closed Alishah634 closed 3 months ago

Alishah634 commented 3 months ago

Rationale

This PR resolves #14
The testing system needed to be improved and revamped, so it can be table driven to allow for descriptive tailored test cases for each function of the database.

Usage

N/A

Changes

Non-trivial Files

Code coverage for mysql.go is now from approx. 55% to 65.9%. The remaining percentage is due to error checks that do not need to be tested.

Testing

Dependencies

N/A

Documentation Changes

Issues and Bugs

  1. Found out there is no validation or error checking on the backend for if a user enters an empty string for username, email, password.
  2. Additionally, there needs to be functionality to check whether the email added is valid.

Possible Solutions

Future development will have the variables passed into the function already validated. This kind of validation is not in the scope of this PR, and will require another issue ticket to be opened to be resolved.

Additional Notes

Small concern that while adding table driven unit tests, the code base does increase quite a bit and some Test functions may not require this level of complexity to execute the test cases. Table driven tests may unnecessarily complex for the test cases. For other notes refer to the Issues and Bugs Section of this PR.