-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add test cases for existing events in GitHubEventAction
component
#18
Conversation
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.
Hi Ansh, thank you for your contribution! As-is, this looks good. However, I have a few questions for you:
- I'd like to test the content of the links as well (i.e. the
href
), to see if we properly interpret the API. Is this something you could add to this PR? - As we add more events, I think inlining everything in the test file itself is probably not sustainable. In addition, we're currently testing a fragment of the data returned, rather than the entire input. Could we:
- move all the test input data (the "fixtures") to their own file(s)? I think one file per test fixture may make sense, but feel free to give me feedback on this idea.
- include the entire GitHub API response in the test fixture? instead of just the data that we'd need
Hey, thanks for the review. I'll be working on these on the weekend. |
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.
Hi Ansh, looks good! I've left some very minor (naming-related) comments, but other than that we're in pretty good shape to merge. Thanks for all your work so far!
(p.s. - can you add newlines to the end of your JSON files? leads to clean diffs!)
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.
This looks great. Nice job Ansh, the contribution is much appreciated. I'll go ahead and merge.
Closes #16
Hi, I've setup a basic framework for testing events in this component. For future development, we can just keep adding more objects in the
testCases
array with the expected output. I've added atestContext
key (optional) which can be used to give more context to the test name. Like handling singular and plural cases etc...I've kept the
payload
minimal to avoid bloating the file with lots of data. That would've made writing new test cases harder. I would love to know your thoughts on this approach.