Skip to content

fix: pasting request ito parent folder even if request is selected#6446

Merged
sid-bruno merged 4 commits intousebruno:mainfrom
pooja-bruno:fix/pasting-request-into-parent-folder
Dec 24, 2025
Merged

fix: pasting request ito parent folder even if request is selected#6446
sid-bruno merged 4 commits intousebruno:mainfrom
pooja-bruno:fix/pasting-request-into-parent-folder

Conversation

@pooja-bruno
Copy link
Collaborator

@pooja-bruno pooja-bruno commented Dec 18, 2025

Description

Fixed an issue where pasting an item while a request was selected didn’t work. The item is now correctly pasted into the parent folder or collection.

JIRA

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.
Screen.Recording.2025-12-18.at.1.56.44.PM.mov

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved paste behavior: pasting into non-folder items now targets the parent folder while pasting into folders remains unchanged.
    • Added user-facing error notifications when paste operations fail.
  • Tests

    • Expanded copy/paste test coverage to verify keyboard copy/paste flows and that pasted items retain their names.
    • Added a test utility to programmatically create requests for reliable automation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Warning

Rate limit exceeded

@pooja-bruno has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc461e and 26ea57f.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (2 hunks)
  • tests/request/copy-request/copy-request.spec.ts (2 hunks)

Walkthrough

Pasting behavior changed: when pasting, folders are targeted directly; non-folder items resolve to their parent folder (or null) as the paste target. Dispatch signature updated to use collectionUid and targetFolderUid. Tests and a page helper for creating requests were added.

Changes

Cohort / File(s) Summary
Paste logic enhancement
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
Imported findParentItemInCollection. handlePasteItem now sets targetFolderUid: uses the item's uid if it's a folder, otherwise finds the parent folder uid (or null). Updated dispatch to call pasteItem(collectionUid, targetFolderUid) and added .catch to show a toast on failures; added inline comments.
Test coverage & helpers
tests/request/copy-request/copy-request.spec.ts, src/utils/page*
Added/used createRequest(page, name, collectionName) test helper. Added a test that copies a request (via keyboard shortcut) and pastes, asserting the pasted request appears in the parent folder with the same name.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Files to focus on:
    • CollectionItem/index.js — correctness of parent lookup and null handling for root items
    • Call sites and reducers/actions that consume pasteItem — ensure parameter change matches expected signature
    • New test copy-request.spec.ts — flakiness in keyboard/async assertions and reliance on createRequest helper

Possibly related PRs

Suggested labels

size/M

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

✂️ Copy then paste, it seeks a home,
If not a folder, to parent it roams.
A catch for the errors, a test to ensure,
Small tweak, steady hands — paste now more sure. 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title contains a typo ('ito' instead of 'into') and accurately describes the main fix: enabling paste operations into parent folders even when a request is selected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)

540-555: Add guard check for collection before calling findParentItemInCollection.

The core logic is correct and error handling is good. However, findParentItemInCollection will throw if collection is undefined. While the parent component normally ensures a valid collection, the useSelector lookup can theoretically fail if the collectionUid doesn't exist in Redux state.

Add a guard to prevent potential runtime errors:

  const handlePasteItem = () => {
    // Determine target folder: if item is a folder, paste into it; otherwise paste into parent folder
    let targetFolderUid = item.uid;
    if (!isFolder) {
+     if (!collection) {
+       toast.error('Collection not found');
+       return;
+     }
      const parentFolder = findParentItemInCollection(collection, item.uid);
      targetFolderUid = parentFolder ? parentFolder.uid : null;
    }

The pasteItem action correctly handles null as targetFolderUid for root-level requests.

🧹 Nitpick comments (1)
tests/request/copy-request/copy-request.spec.ts (1)

70-82: Consider using test.step for better test reporting.

The coding guidelines recommend using test.step to break tests into logical steps for easier-to-read reports. This would make the test structure clearer.

🔎 View suggested refactor:
  test('should paste request into parent folder even if request is selected', async ({ page, createTmpDir }) => {
-   // Create a collection and a request
-   await createCollection(page, 'test-collection-3', await createTmpDir('test-collection-3'), { openWithSandboxMode: 'safe' });
-   await createRequest(page, 'request-to-copy', 'test-collection-3');
-
-   // Copy the request
-   await page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' }).click();
-   await page.keyboard.press('Meta+C');
-   await page.keyboard.press('Meta+V');
-
-   // Verify the pasted request appears with the same name
-   await expect(page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' })).toHaveCount(2);
+   await test.step('Create collection and request', async () => {
+     await createCollection(page, 'test-collection-3', await createTmpDir('test-collection-3'), { openWithSandboxMode: 'safe' });
+     await createRequest(page, 'request-to-copy', 'test-collection-3');
+   });
+
+   await test.step('Copy and paste the request', async () => {
+     await page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' }).click();
+     await page.keyboard.press(process.platform === 'darwin' ? 'Meta+C' : 'Control+C');
+     await page.keyboard.press(process.platform === 'darwin' ? 'Meta+V' : 'Control+V');
+   });
+
+   await test.step('Verify pasted request appears', async () => {
+     await expect(page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' })).toHaveCount(2);
+   });
  });

As per coding guidelines, which state: "Promote the use of test.step as much as possible so the generated reports are easier to read."

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78ee99e and a0cea6f.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (2 hunks)
  • tests/request/copy-request/copy-request.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • tests/request/copy-request/copy-request.spec.ts
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
tests/**/**.*

⚙️ CodeRabbit configuration file

tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:

  • Follow best practices for Playwright code and e2e automation

  • Try to reduce usage of page.waitForTimeout(); in code unless absolutely necessary and the locator cannot be found using existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture Example*: Here's an example of possible fixture and test pair

    .
    ├── fixtures
    │   └── collection
    │       ├── base.bru
    │       ├── bruno.json
    │       ├── collection.bru
    │       ├── ws-test-request-with-headers.bru
    │       ├── ws-test-request-with-subproto.bru
    │       └── ws-test-request.bru
    ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection
    ├── headers.spec.ts
    ├── persistence.spec.ts
    ├── variable-interpolation
    │   ├── fixtures
    │   │   └── collection
    │   │       ├── environments
    │   │       ├── bruno.json
    │   │       └── ws-interpolation-test.bru
    │   ├── init-user-data
    │   └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection
    └── subproto.spec.ts
    

Files:

  • tests/request/copy-request/copy-request.spec.ts
🧠 Learnings (2)
📚 Learning: 2025-12-16T07:16:08.934Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:08.934Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.

Applied to files:

  • tests/request/copy-request/copy-request.spec.ts
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.

Applied to files:

  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js
🧬 Code graph analysis (2)
tests/request/copy-request/copy-request.spec.ts (2)
tests/utils/page/actions.ts (2)
  • createCollection (717-717)
  • createRequest (718-718)
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js (2)
  • createCollection (2296-2316)
  • createCollection (2296-2316)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (2)
packages/bruno-app/src/utils/collections/index.js (2)
  • findParentItemInCollection (123-129)
  • findParentItemInCollection (123-129)
packages/bruno-electron/src/utils/collection.js (1)
  • findParentItemInCollection (258-264)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Unit Tests
  • GitHub Check: CLI Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Linux
🔇 Additional comments (2)
tests/request/copy-request/copy-request.spec.ts (1)

2-2: LGTM!

The import statement correctly adds the createRequest helper and follows the coding guidelines.

packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js (1)

51-51: Import looks good.

The findParentItemInCollection import is correctly added and used appropriately in the handlePasteItem function.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/request/copy-request/copy-request.spec.ts (1)

70-84: Enhance test readability and coverage with test.step and additional assertions.

The test logic is solid, but following the coding guidelines, consider adding test.step blocks for better reporting and additional assertions to thoroughly verify the paste behavior.

🔎 View suggested enhancement:
  test('should paste request into parent folder even if request is selected', async ({ page, createTmpDir }) => {
-   // Create a collection and a request
-   await createCollection(page, 'test-collection-3', await createTmpDir('test-collection-3'), { openWithSandboxMode: 'safe' });
-   await createRequest(page, 'request-to-copy', 'test-collection-3');
-
-   const modifier = process.platform === 'darwin' ? 'Meta' : 'Control';
-
-   // Copy the request
-   await page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' }).click();
-   await page.keyboard.press(`${modifier}+KeyC`);
-   await page.keyboard.press(`${modifier}+KeyV`);
-
-   // Verify the pasted request appears with the same name
-   await expect(page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' })).toHaveCount(2);
+   await test.step('Create a collection and a request', async () => {
+     await createCollection(page, 'test-collection-3', await createTmpDir('test-collection-3'), { openWithSandboxMode: 'safe' });
+     await createRequest(page, 'request-to-copy', 'test-collection-3');
+     await expect(page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' })).toHaveCount(1);
+   });
+
+   await test.step('Copy and paste the request using keyboard shortcuts', async () => {
+     const modifier = process.platform === 'darwin' ? 'Meta' : 'Control';
+     await page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' }).click();
+     await page.keyboard.press(`${modifier}+C`);
+     await page.keyboard.press(`${modifier}+V`);
+   });
+
+   await test.step('Verify the pasted request appears in the collection', async () => {
+     const requests = page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' });
+     await expect(requests).toHaveCount(2);
+     // Additional assertion to verify both requests are visible
+     await expect(requests.first()).toBeVisible();
+     await expect(requests.last()).toBeVisible();
+   });
  });

As per coding guidelines, this promotes the use of test.step for easier-to-read reports and adds multiple assertions for more thorough verification.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0cea6f and ee2d7ec.

📒 Files selected for processing (1)
  • tests/request/copy-request/copy-request.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • tests/request/copy-request/copy-request.spec.ts
tests/**/**.*

⚙️ CodeRabbit configuration file

tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:

  • Follow best practices for Playwright code and e2e automation

  • Try to reduce usage of page.waitForTimeout(); in code unless absolutely necessary and the locator cannot be found using existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture Example*: Here's an example of possible fixture and test pair

    .
    ├── fixtures
    │   └── collection
    │       ├── base.bru
    │       ├── bruno.json
    │       ├── collection.bru
    │       ├── ws-test-request-with-headers.bru
    │       ├── ws-test-request-with-subproto.bru
    │       └── ws-test-request.bru
    ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection
    ├── headers.spec.ts
    ├── persistence.spec.ts
    ├── variable-interpolation
    │   ├── fixtures
    │   │   └── collection
    │   │       ├── environments
    │   │       ├── bruno.json
    │   │       └── ws-interpolation-test.bru
    │   ├── init-user-data
    │   └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection
    └── subproto.spec.ts
    

Files:

  • tests/request/copy-request/copy-request.spec.ts
🧠 Learnings (2)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.test.{js,jsx,ts,tsx} : Add tests for any new functionality or meaningful changes. If code is added, removed, or significantly modified, corresponding tests should be updated or created

Applied to files:

  • tests/request/copy-request/copy-request.spec.ts
📚 Learning: 2025-12-16T07:16:08.934Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:08.934Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.

Applied to files:

  • tests/request/copy-request/copy-request.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: CLI Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: Unit Tests
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - macOS

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/request/copy-request/copy-request.spec.ts (1)

70-84: Keyboard shortcuts fixed correctly; consider adding test.step blocks.

The platform-specific modifier detection and keyboard shortcut format are now correct. The test logic properly validates the paste behavior when a request is selected.

However, the test would benefit from test.step blocks to improve test reporting clarity. Consider wrapping logical actions (setup, copy operation, paste operation, verification) in separate steps.

🔎 View suggested enhancement with test.step blocks:
  test('should paste request into parent folder even if request is selected', async ({ page, createTmpDir }) => {
-   // Create a collection and a request
-   await createCollection(page, 'test-collection-3', await createTmpDir('test-collection-3'), { openWithSandboxMode: 'safe' });
-   await createRequest(page, 'request-to-copy', 'test-collection-3');
-
-   const modifier = process.platform === 'darwin' ? 'Meta' : 'Control';
-
-   // Copy the request
-   await page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' }).click();
-   await page.keyboard.press(`${modifier}+C`);
-   await page.keyboard.press(`${modifier}+V`);
-
-   // Verify the pasted request appears with the same name
-   await expect(page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' })).toHaveCount(2);
+   await test.step('Create a collection and a request', async () => {
+     await createCollection(page, 'test-collection-3', await createTmpDir('test-collection-3'), { openWithSandboxMode: 'safe' });
+     await createRequest(page, 'request-to-copy', 'test-collection-3');
+   });
+
+   const modifier = process.platform === 'darwin' ? 'Meta' : 'Control';
+
+   await test.step('Copy the request using keyboard shortcut', async () => {
+     await page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' }).click();
+     await page.keyboard.press(`${modifier}+C`);
+   });
+
+   await test.step('Paste the request using keyboard shortcut', async () => {
+     await page.keyboard.press(`${modifier}+V`);
+   });
+
+   await test.step('Verify the pasted request appears', async () => {
+     await expect(page.locator('.collection-item-name').filter({ hasText: 'request-to-copy' })).toHaveCount(2);
+   });
  });

As per coding guidelines, this improves test reporting and makes the test flow easier to understand.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee2d7ec and 5cc461e.

📒 Files selected for processing (1)
  • tests/request/copy-request/copy-request.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • tests/request/copy-request/copy-request.spec.ts
tests/**/**.*

⚙️ CodeRabbit configuration file

tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:

  • Follow best practices for Playwright code and e2e automation

  • Try to reduce usage of page.waitForTimeout(); in code unless absolutely necessary and the locator cannot be found using existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture Example*: Here's an example of possible fixture and test pair

    .
    ├── fixtures
    │   └── collection
    │       ├── base.bru
    │       ├── bruno.json
    │       ├── collection.bru
    │       ├── ws-test-request-with-headers.bru
    │       ├── ws-test-request-with-subproto.bru
    │       └── ws-test-request.bru
    ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection
    ├── headers.spec.ts
    ├── persistence.spec.ts
    ├── variable-interpolation
    │   ├── fixtures
    │   │   └── collection
    │   │       ├── environments
    │   │       ├── bruno.json
    │   │       └── ws-interpolation-test.bru
    │   ├── init-user-data
    │   └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection
    └── subproto.spec.ts
    

Files:

  • tests/request/copy-request/copy-request.spec.ts
🧠 Learnings (3)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.test.{js,jsx,ts,tsx} : Add tests for any new functionality or meaningful changes. If code is added, removed, or significantly modified, corresponding tests should be updated or created

Applied to files:

  • tests/request/copy-request/copy-request.spec.ts
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Use consistent patterns and helper utilities where they improve clarity. Prefer shared test utilities over copy-pasted setup code, but only when it actually reduces complexity

Applied to files:

  • tests/request/copy-request/copy-request.spec.ts
📚 Learning: 2025-12-16T07:16:08.934Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:08.934Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.

Applied to files:

  • tests/request/copy-request/copy-request.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: CLI Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: Unit Tests
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Windows
🔇 Additional comments (1)
tests/request/copy-request/copy-request.spec.ts (1)

2-2: LGTM! Good use of shared utility.

The createRequest helper import simplifies test setup and reduces code duplication across test files.

@pooja-bruno pooja-bruno force-pushed the fix/pasting-request-into-parent-folder branch from 5cc461e to 4f3498d Compare December 18, 2025 12:18
@sid-bruno sid-bruno merged commit 1f05ffd into usebruno:main Dec 24, 2025
8 checks passed
bijin-bruno added a commit that referenced this pull request Feb 13, 2026
* feat: button storybook

* feat: update button component with new rounded options and story

* fix: pasting request ito parent folder even if request is selected (#6446)

* Add right-click context menu to request tabs with MenuDropdown # (#6502)

* refactor: replace Dropdown with MenuDropdown in RequestTab component; update Dropdown props handling in Dropdown component

* refactor: remove Portal import and simplify menuDropdown rendering in RequestTab component

* refactor: streamline RequestTabMenu functionality and improve tab closing methods with async handling

* refactor: enhance Dropdown and MenuDropdown components with improved props handling and styling adjustments

* refactor: enhance Dropdown and MenuDropdown components by improving structure and removing unused styles

* refactor: update Dropdown and MenuDropdown components to append to sidebar sections container for improved layout

* refactor: integrate dropdownContainerRef for improved MenuDropdown positioning in RequestTabs and Sidebar components

* refactor: update Dropdown component to include 'tippy-box' class for e2e test selections

* refactor: update dropdown item selection logic in selectRequestPaneTab function for improved accuracy

* refactor: add fixed positioning to popperOptions in Collection and CollectionItem components for improved dropdown behavior

---------

Co-authored-by: sanjai <sanjai@usebruno.com>

* export & import in opencollection format (#6329)

---------

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
Co-authored-by: Anoop M D <anoop@usebruno.com>
Co-authored-by: Pooja <pooja@usebruno.com>
Co-authored-by: Abhishek S Lal <abhishek@usebruno.com>
Co-authored-by: sanjai <sanjai@usebruno.com>
Co-authored-by: naman-bruno <naman@usebruno.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants