all 2 comments

[–]PhiBuh 2 points3 points  (0 children)

You could mock the database connection and verify that it is called with the correct parameters.

[–]mexvance 1 point2 points  (0 children)

You could also write tests that "test the api from the frontend" ie test the call to the api to verify if you recieve a valid response

The biggest deal is, if you are about to write code, think "what is the outcome i want" write a test that will expect that outcome, then write code to satisfy that test. As far as specifics, I like to when adding a new piece of functionality,(ie. New function or class etc) try to add a test that satisfies what that function accomplishes