test: add tests for RegisterReceiveOperation in python websocket component#1967
Conversation
|
What reviewer looks at during PR reviewThe following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
|
📝 WalkthroughWalkthroughAdds a new snapshot test for the RegisterReceiveOperations component and updates AsyncAPI fixtures to include receive operations and a minor formatting change in an existing fixture. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6c83ff7 to
d358765
Compare
| beforeAll(async () => { | ||
| const parseResult = await fromFile(parser, asyncapiWebsocketQuery).parse(); | ||
| parsedAsyncAPIDocument = parseResult.document; | ||
| expect(parsedAsyncAPIDocument).toBeDefined(); |
There was a problem hiding this comment.
this is not needed, you can remove it.
| test('renders nothing without receive operations', () => { | ||
| const result = render(<RegisterReceiveOperations />); | ||
| const actual = result.trim(); | ||
| expect(actual).toBe(''); | ||
| }); | ||
|
|
||
| test('renders nothing when receiveOperations is undefined', () => { | ||
| const result = render(<RegisterReceiveOperations receiveOperations={undefined} />); | ||
| const actual = result.trim(); | ||
| expect(actual).toBe(''); | ||
| }); |
There was a problem hiding this comment.
Both test cases are essentially testing the same thing — when no receiveOperations prop is passed, it defaults to undefined, so the component receives undefined either way. Remove the last testcase not needed.
b2acc2e to
ff32ed7
Compare
8697360 to
c9c2b3a
Compare
|
|
/rtm |



Adds comprehensive tests for the
RegisterReceiveOperationscomponent in the Python WebSocket client template.Fixes #1908
Summary by CodeRabbit
Tests
Tests / Fixtures