Hi, I'm trying to add authorization to the new api...
# help
u
Hi, I'm trying to add authorization to the new api endpoint I created in PR #751, but I don't understand how to test it
b
Hi, adding new api - api/api_controller.go can be tested using api/api_controller_test.go
each func TestHandlerXXX function there setup an env for testing our api handlers
Copy code
handler, deps := getHandler(t)
from there it will be calling the new implemented api and test the expected results
In case you need to setup a different block adapter or mock it in a different way - you can check how we setup the handler in the
getHandler
implementation or modify it to enable a custom block handler for your test
u
I wrote a test, and it passes whether I use setupRequest or not... I feel like I'm missing something
I pushed the latest version with test and all
Can you have a look?
b
I'll take a look soon
image.png
you can hit the re-request review when you are done
the review will get the notification
u
מטורף!
לא הכרתי את זה
תודה רבה לך
👍 1