Add test cases for existing events in GitHubEventAction component#18
Add test cases for existing events in GitHubEventAction component#18mattxwang merged 9 commits intouclaacm:mainfrom
GitHubEventAction component#18Conversation
mattxwang
left a comment
There was a problem hiding this comment.
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. |
mattxwang
left a comment
There was a problem hiding this comment.
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!)
mattxwang
left a comment
There was a problem hiding this comment.
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
testCasesarray with the expected output. I've added atestContextkey (optional) which can be used to give more context to the test name. Like handling singular and plural cases etc...I've kept the
payloadminimal 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.