Skip to content

test: fix unmatched mocked polymarket mocks#30194

Merged
cortisiko merged 6 commits into
mainfrom
e2e/mock-pred-endpoints
May 14, 2026
Merged

test: fix unmatched mocked polymarket mocks#30194
cortisiko merged 6 commits into
mainfrom
e2e/mock-pred-endpoints

Conversation

@cortisiko
Copy link
Copy Markdown
Member

@cortisiko cortisiko commented May 14, 2026

Description

Prevents Polymarket E2E tests from leaking live requests by adding a default gamma-api.polymarket.com/events/{id} mock response and ensuring it matches any numeric event id.

Updates the trending feed mock for event details to use the same generalized numeric-id matcher (instead of hard-coding /events/1), so prefetch/highlight flows don’t crash on unmatched ids.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk: changes are limited to E2E test mocks/fixtures and onboarding test flow, reducing flaky/unmocked network calls without touching production logic.

Overview
Prevents Polymarket E2E tests from leaking live requests by adding a default gamma-api.polymarket.com/events/{id} mock and broadening existing trending-feed event-detail mocks to match any numeric event id.

Updates onboarding E2E flows to proceed past the new OnboardingInterestQuestionnaire step when opting into MetaMetrics, adds a page-object wrapper for that screen, and seeds onboarding-fixture.json with a stable @MetaMask:AnalyticsId.

Reviewed by Cursor Bugbot for commit 91267e4. Bugbot is set up for automated code reviews on this repo. Configure here.

@cortisiko cortisiko requested a review from a team as a code owner May 14, 2026 16:19
@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 14, 2026
@metamaskbotv2 metamaskbotv2 Bot added the team-qa QA team label May 14, 2026
@cortisiko cortisiko added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed no changelog required No changelog entry is required for this change and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels May 14, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.83%. Comparing base (3751d9a) to head (943ae9d).
⚠️ Report is 194 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30194      +/-   ##
==========================================
+ Coverage   81.54%   81.83%   +0.28%     
==========================================
  Files        5343     5408      +65     
  Lines      142128   144344    +2216     
  Branches    32411    32967     +556     
==========================================
+ Hits       115899   118122    +2223     
+ Misses      18299    18139     -160     
- Partials     7930     8083     +153     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

chrisleewilcox
chrisleewilcox previously approved these changes May 14, 2026
Comment thread tests/api-mocking/mock-responses/defaults/polymarket-apis.ts
hjetpoluru
hjetpoluru previously approved these changes May 14, 2026
@cortisiko
Copy link
Copy Markdown
Member Author

@metamaskbot update-mobile-fixture

@github-actions
Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch e2e/mock-pred-endpoints. View workflow runs

@github-actions
Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@github-actions
Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@cortisiko
Copy link
Copy Markdown
Member Author

@metamaskbot update-mobile-fixture

@github-actions
Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch e2e/mock-pred-endpoints. View workflow runs

@github-actions
Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@cortisiko cortisiko dismissed stale reviews from chrisleewilcox and hjetpoluru via 9a501a5 May 14, 2026 21:45
Comment thread tests/flows/wallet.flow.ts Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 502e0c3. Configure here.

Comment thread tests/flows/wallet.flow.ts
@github-actions github-actions Bot added size-M and removed size-S labels May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: %
click to see 🤖 AI reasoning details

E2E Test Selection:
Fallback: AI analysis did not complete successfully. Running all tests.

Performance Test Selection:
Fallback: AI analysis did not complete successfully. Running all performance tests.

View GitHub Actions results

@cortisiko cortisiko enabled auto-merge May 14, 2026 22:40
@sonarqubecloud
Copy link
Copy Markdown

@cortisiko cortisiko added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 0fe8aaa May 14, 2026
116 checks passed
@cortisiko cortisiko deleted the e2e/mock-pred-endpoints branch May 14, 2026 23:43
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants