redwood-tutorial icon indicating copy to clipboard operation
redwood-tutorial copied to clipboard

fix: Add id to mockCurrentUser

Open Alonski opened this issue 3 years ago • 3 comments

According to Typescript mockCurrentUser expects a required id.

In Javascript we don't notice this.

Come to think of it... Should this tutorial be in Typescript? Or maybe should we offer a Typescript version?

Alonski avatar Oct 13 '22 17:10 Alonski

@Alonski does the test fail due to the lack of the id?

dthyresson avatar Oct 21 '22 14:10 dthyresson

@dthyresson I'm not sure if the test fails or not. I can check. I just found this while converting to Typescript

Alonski avatar Oct 21 '22 15:10 Alonski

Hmm, what if the primary key column isn't named id? Is the Typescript behind there actually smart enough to know that, and expect the correct key there, or is it just hardcoded to id somewhere?

When we originally wrote mockCurrentUser I thought it just took an object and presented that as the return from any currentUser call...not sure why it would need to require a certain set of keys on that object?

cannikin avatar Nov 07 '22 18:11 cannikin