Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (15)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughWebSocket message creation now initializes empty content, and WS schema/theme data add ChangesWebSocket Default Body and Message Styling
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
tests/websockets/message-body-default.spec.ts (1)
11-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winWrap steps in
test.stepfor clearer reports.The test performs distinct phases (open request, add message, assert placeholder) but doesn't use
test.step, making failure reports less granular.♻️ Proposed refactor
test('a newly added message defaults to an empty body showing the placeholder', async ({ pageWithUserData: page }) => { - // Open the preloaded websocket request - await page.getByTestId('sidebar-collection-row').click(); - await page.getByTitle(REQ_NAME).click(); - - const headers = page.getByTestId(/^ws-message-header-/); - const beforeCount = await headers.count(); - - await page.getByTestId('ws-add-message').click(); - await expect(headers).toHaveCount(beforeCount + 1); - - // The newly added message is the last one and auto-expands. - const newBody = page.getByTestId(`ws-message-body-${beforeCount}`); - await expect(newBody).toBeVisible(); - - const editor = newBody.locator('.CodeMirror'); - // Body should be empty (previously defaulted to '{}'); the editor should - // surface the '...' placeholder instead of any '{}' content. - await expect(editor.locator('.CodeMirror-placeholder')).toHaveText('...'); - await expect(editor.locator('.CodeMirror-code')).not.toContainText('{}'); + const headers = page.getByTestId(/^ws-message-header-/); + let beforeCount = 0; + + await test.step('Open the preloaded websocket request', async () => { + await page.getByTestId('sidebar-collection-row').click(); + await page.getByTitle(REQ_NAME).click(); + beforeCount = await headers.count(); + }); + + await test.step('Add a new message', async () => { + await page.getByTestId('ws-add-message').click(); + await expect(headers).toHaveCount(beforeCount + 1); + }); + + await test.step('Assert new message defaults to empty body placeholder', async () => { + const newBody = page.getByTestId(`ws-message-body-${beforeCount}`); + await expect(newBody).toBeVisible(); + + const editor = newBody.locator('.CodeMirror'); + await expect(editor.locator('.CodeMirror-placeholder')).toHaveText('...'); + await expect(editor.locator('.CodeMirror-code')).not.toContainText('{}'); + }); });As per path instructions, "Promote the use of
test.stepas much as possible so the generated reports are easier to read."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/websockets/message-body-default.spec.ts` around lines 11 - 33, Wrap the distinct phases in the websocket test in `test.step` blocks to make reporting more granular: separate the request-opening flow, the message-add action, and the placeholder/body assertions in `message-body-default.spec.ts`. Keep the existing logic the same, but structure the test around the `test` callback and its `pageWithUserData` flow so failures are easier to pinpoint in reports.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/websockets/message-body-default.spec.ts`:
- Around line 11-33: Wrap the distinct phases in the websocket test in
`test.step` blocks to make reporting more granular: separate the request-opening
flow, the message-add action, and the placeholder/body assertions in
`message-body-default.spec.ts`. Keep the existing logic the same, but structure
the test around the `test` callback and its `pageWithUserData` flow so failures
are easier to pinpoint in reports.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8385841f-33bb-4eab-bf6b-b9d2137e477c
📒 Files selected for processing (9)
packages/bruno-app/src/components/RequestPane/WSRequestPane/index.jspackages/bruno-app/src/components/RequestPane/WsBody/BodyMode/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/WsBody/SingleWSMessage/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/WsBody/StyledWrapper.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-app/src/themes/dark/dark-monochrome.jspackages/bruno-app/src/themes/schema/oss.jstests/websockets/fixtures/collection/ws-default-body-request.brutests/websockets/message-body-default.spec.ts
Description
JIRA
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
{}).activeMessage.label.