-
-
Notifications
You must be signed in to change notification settings - Fork 97
Unit testing for Recurring Events router #1911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit testing for Recurring Events router #1911
Conversation
dannyprikaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jng34
You're killing it with these PRs. As I was going through some of these, I realized that I was being lazy with my own tests of routes that were passing the request to a controller, and I ultimately found a solution that I think you should apply to these tests as well.
Prime example is line 137 of backend/routers/recurringEvents.router.test.js. Right now we're just expecting that the create method is being called, but we really want to make sure it's being called with the correct input, namely newEvent. The problem that I was having (and that I'm sure you ran into), is that the controller method is getting passed a ton more than just newEvent. I found a solution, that I put in the comments here and that I incorporated into my own PR. Please update your code to use this expectation where necessary.
Thanks!
jng34
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dannyprikaz
Thank you again for your review and pointers.
It is making a lot more sense now with the specifications of the tests.
I have made the updates. Please review once more when you have time.
|
@dannyprikaz please hold off on reviewing this PR. I am currently working on writing tests for error handling as we discussed last week. I will drop a comment to let you know when I have added those tests and the PR is ready for review again. |
|
Hi @jng34 FYI - I added the |
|
@dannyprikaz |
dannyprikaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Fixes #1894
What changes did you make and why did you make them ?
recurringEvents.routercatchblock of the"/internal"route inrecurringEvents.routerScreenshots of Passed Tests