test: add test coverage for Constructor#1949
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 integration test suite for the WebSocket Constructor component in the Java Quarkus template that parses an AsyncAPI fixture and verifies rendering behavior for null, empty, and valid 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@packages/templates/clients/websocket/java/quarkus/test/components/Constructor.test.js`:
- Around line 6-11: The file has unintended double blank lines around the setup
lines creating Parser and resolving asyncapiFilePath; remove the extra empty
lines so there is a single blank line (or none) between the top imports and the
lines "const parser = new Parser();" and between that and "const
asyncapiFilePath = path.resolve(...)" to satisfy the no-multiple-empty-lines
rule; update the block containing Parser and asyncapiFilePath to have only
single spacing.
🧹 Nitpick comments (1)
packages/templates/clients/websocket/java/quarkus/test/components/Constructor.test.js (1)
13-21:parsedAsyncAPIDocumentandchannelsare unused outsidebeforeAll.
parsedAsyncAPIDocumentis assigned but never read after line 19, andchannelsis only used to derivequeryParams. You can scope them locally insidebeforeAlland keep onlyqueryParamsat thedescribelevel.Proposed simplification
describe('Constructor component (integration with AsyncAPI document)', () => { - let parsedAsyncAPIDocument; - let channels; let queryParams; beforeAll(async () => { const parseResult = await fromFile(parser, asyncapiFilePath).parse(); - parsedAsyncAPIDocument = parseResult.document; - channels = parsedAsyncAPIDocument.channels(); + const parsedAsyncAPIDocument = parseResult.document; + const channels = parsedAsyncAPIDocument.channels(); queryParams = getQueryParams(channels); });
packages/templates/clients/websocket/java/quarkus/test/components/Constructor.test.js
Outdated
Show resolved
Hide resolved
|
|
/rtm |
Co-authored-by: Harsh Gupta <harsh16official@gmail.com> Co-authored-by: Adi Boghawala <adiboghawala@gmail.com>



Description
Adds comprehensive integration tests for the
Constructorcomponent in the Java Quarkus WebSocket client template.Related Issue
Fixes #1887
Summary by CodeRabbit