Skip to content

test(tabs): enhance tab migration tests and add restoreTabs functionality - #8609

Merged
utkarsh-bruno merged 1 commit into
usebruno:mainfrom
utkarsh-bruno:fix/BRU-3859
Jul 15, 2026
Merged

utkarsh-bruno merged 1 commit into
usebruno:mainfrom
utkarsh-bruno:fix/BRU-3859

Conversation

@utkarsh-bruno

@utkarsh-bruno utkarsh-bruno commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Updated tab migration tests to use path.join for pathname consistency.
  • Added tests for restoreTabs to ensure remapped .yml request paths are skipped when reopening a bru collection.
  • Improved handling of stale request paths in the tabs slice reducer during collection restoration.

BRU-3859

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.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented outdated request tabs from reopening when a collection’s file format has changed.
    • Ensured collection and folder settings tabs continue to restore correctly.
  • Tests
    • Added coverage for restoring tabs after collection format migration.
    • Updated migration tests to validate platform-independent file paths.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The tab migration tests now use CommonJS imports and normalized path construction. restoreTabs filters snapshot tabs whose extensions do not match the collection format, with new coverage for remapped request tabs.

Changes

Tab restoration

Layer / File(s) Summary
Normalize migration test paths
packages/bruno-app/src/providers/ReduxStore/slices/tabs-migrate.spec.js
Migration fixtures and expected pathnames now use path.join-based construction and CommonJS setup.
Filter stale restored tabs
packages/bruno-app/src/providers/ReduxStore/slices/tabs.js, packages/bruno-app/src/providers/ReduxStore/slices/tabs-migrate.spec.js
restoreTabs skips snapshot tabs with extensions inconsistent with collection.format; tests verify remapped request tabs are excluded.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: ravindra-bruno, naman-bruno, bijin-bruno, sid-bruno, abhishek-bruno

Poem

Old paths drift, new formats gleam,
Stale tabs fade from the restore stream.
BRU becomes YML in flight,
Tests keep every pathname right.
Clean tabs return, just as they should.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the added restoreTabs logic and expanded tab migration tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@utkarsh-bruno
utkarsh-bruno merged commit 8c491a5 into usebruno:main Jul 15, 2026
13 of 18 checks passed
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