julianpoy / RecipeSage

A Collaborative Recipe Keeper, Meal Planner, and Shopping List Organizer in PWA form.
https://recipesage.com
612 stars 61 forks source link

Meal Plan tests #1378

Closed UlianaPurtova closed 2 months ago

UlianaPurtova commented 4 months ago

part 1 of unit tests for meal plan

julianpoy commented 4 months ago

If you wouldn't mind for both this PR and the other - it'd be useful to create a method for creating extra users, rather than calling setup again.

UlianaPurtova commented 3 months ago

If you wouldn't mind for both this PR and the other - it'd be useful to create a method for creating extra users, rather than calling setup again.

hi @julianpoy , sorry it took me a bit long to get back could you clarify how do you see this? Because technically I already do have a method to specifically create an extra user and a session, they are exported it's just it's convenient to call trpcSetup to do all of these things for me at once

maybe I should rename a function for a better name or make the trpcSetup take an optional argument to create an extra user at one go? like trpcSetup(setupExtraUser = false )

thank you!

julianpoy commented 2 months ago

No worries, sorry for the delay in getting back to you as well!

like trpcSetup(setupExtraUser = false )

That'd be great, yeah! There are a lot of scenarios that require testing multiple users, so perhaps just creating two users by default would be good, even if both are not used in all tests.

julianpoy commented 2 months ago

I'm going to go ahead and merge this and you are welcome to follow up in a new PR with the changes discussed