Skip to content

Conversation

@dereknance
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-27862

📔 Objective

This PR is a follow-up to #17245 for fixing the memory storage tests that were skipped as part of those changes.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

This commit fixes the tests that were skipped as part of #17245.
@dereknance dereknance requested a review from a team as a code owner December 31, 2025 18:19
@dereknance dereknance requested a review from djsmith85 December 31, 2025 18:19
@dereknance dereknance added the ai-review Request a Claude code review label Dec 31, 2025
@dereknance dereknance enabled auto-merge (squash) December 31, 2025 18:20
@claude
Copy link
Contributor

claude bot commented Dec 31, 2025

Claude finished @dereknance's task in 2m 8s —— View job


Overall Assessment: APPROVE

This PR correctly fixes the skipped memory storage tests from #17245 by completing the mock port implementation and using the appropriate Jest cleanup method.

Code Review Details

Changes Reviewed:

  • apps/browser/spec/mock-port.spec-util.ts - Added origin property to mock port sender
  • apps/browser/src/platform/storage/memory-storage-service-interactions.spec.ts - Un-skipped tests and switched to clearAllMocks()

Analysis:

The root cause of the test failures was that PR #17245 added BrowserApi.senderIsInternal() validation which checks sender?.origin, but the mock only provided sender.url. Adding the origin property completes the mock to match real Chrome runtime port behavior.

The change from jest.resetAllMocks() to jest.clearAllMocks() is correct because:

  • resetAllMocks() would reset the mock implementations set up in beforeEach
  • clearAllMocks() preserves implementations while clearing call history
  • This pattern is consistent with other test files in the browser codebase

No issues found. The changes are minimal, targeted, and correctly address the test failures.


🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 [email protected]

@github-actions
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details7d0eab67-46b8-4c42-8e3b-96c775f72009

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.32%. Comparing base (c6b0208) to head (9ece594).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18168      +/-   ##
==========================================
+ Coverage   42.27%   42.32%   +0.05%     
==========================================
  Files        3599     3599              
  Lines      104548   104548              
  Branches    15780    15780              
==========================================
+ Hits        44194    44251      +57     
+ Misses      58473    58412      -61     
- Partials     1881     1885       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dereknance dereknance merged commit 6183492 into main Jan 5, 2026
79 of 80 checks passed
@dereknance dereknance deleted the pm-27862-fix-skipped-memory-storage-tests branch January 5, 2026 10:12
@bitwarden bitwarden deleted a comment from diffray-bot Jan 5, 2026
@bitwarden bitwarden deleted a comment from diffray-bot Jan 5, 2026
@bitwarden bitwarden deleted a comment from diffray-bot Jan 5, 2026
@bitwarden bitwarden deleted a comment from diffray-bot Jan 5, 2026
@bitwarden bitwarden deleted a comment from diffray-bot Jan 5, 2026
@bitwarden bitwarden deleted a comment from diffray-bot Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants