feat: Add deterministic Freighter browser mock for E2E testing - #795
Merged
Nanle-code merged 1 commit intoJul 29, 2026
Merged
Conversation
|
@chimdi3850 is attempting to deploy a commit to the nanle-code's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Talentgift24-ux Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#783 [2026 Testing] Add a deterministic Freighter browser mock
Close #783
PR Title
feat: Add deterministic Freighter browser mock for E2E testing
Objective
Exercise connect, reject, sign, lock, account-change, and network-change flows for the Freighter wallet in CI.
Target Area
tests/e2e/fixtures/freighter-mock.jstests/e2e/freighter.spec.jssrc/lib/wallet/freighter.jsDescription
This PR introduces a deterministic browser mock for the Freighter wallet to facilitate robust End-to-End testing in CI. Previously, it was difficult to exercise wallet flows without manual interaction or flaky heuristics.
By injecting a lightweight mock via Playwright (
page.addInitScript), we can accurately simulate thewindow.freighterApiinterface and cover multiple edge cases.Key Changes:
tests/e2e/fixtures/freighter-mock.js):isConnected,isAllowed,getAddress,signTransaction, etc.).window.mockFreighter) to deterministically simulateaccountChange,networkChange,lockstates, and connection/signing rejections.tests/e2e/freighter.spec.js):src/lib/wallet/freighter.js):freighterAccountChange,freighterNetworkChange, andfreighterLockto gracefully support the mock and future-proof the connector for extensions that emit standard CustomEvents.Acceptance Criteria Met