Skip to content

test: adds mock for CLOB auth in prediction#29663

Merged
christopherferreira9 merged 2 commits into
mainfrom
cferreira/enable-back-predict-test
May 4, 2026
Merged

test: adds mock for CLOB auth in prediction#29663
christopherferreira9 merged 2 commits into
mainfrom
cferreira/enable-back-predict-test

Conversation

@christopherferreira9

@christopherferreira9 christopherferreira9 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Description

This PR enables back the predict test that was skipped and adds mocking for the CLOB auth endpoint.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensys.slack.com/archives/C02U025CVU4/p1777884336901849

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A

After

N/A

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 because changes are limited to E2E mocking and a previously skipped smoke test; main risk is increased test flakiness if the new CLOB auth mocks don’t match real request shapes.

Overview
Re-enables the Predictions smoke test for opening a position by ensuring the Polymarket order-placement flow no longer attempts live calls to clob.polymarket.com.

Adds POLYMARKET_CLOB_AUTH_MOCKS to mock both CLOB API-key creation (forced 400) and the derive-key fallback (200), and wires it into POLYMARKET_COMPLETE_MOCKS. Also removes the explicit clob.polymarket.com host entry from the E2E allowlist.

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

@christopherferreira9 christopherferreira9 requested review from a team as code owners May 4, 2026 14:17
@christopherferreira9 christopherferreira9 added team-qa QA team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels May 4, 2026
@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 4, 2026
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the size-S label May 4, 2026
@christopherferreira9 christopherferreira9 removed 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 4, 2026
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The three changed files are all within the E2E test infrastructure for Polymarket/Predictions:

  1. predict-open-position.spec.ts: The describe.skip was removed, re-enabling the SmokePredictions test that was previously disabled due to Android CI failures caused by clob.polymarket.com being unreachable.

  2. polymarket-mocks.ts: Added POLYMARKET_CLOB_AUTH_MOCKS to mock both POST /auth/api-key (returns 400 to trigger fallback) and GET /auth/derive-api-key (returns mock credentials). This mock is integrated into POLYMARKET_COMPLETE_MOCKS, ensuring all Polymarket tests that use the complete mock set benefit from this fix.

  3. mock-e2e-allowlist.ts: Removed clob.polymarket.com from the allowlist since it's now fully mocked and no real network calls should reach it.

SmokePredictions is the primary tag — the test is directly re-enabled and the mock infrastructure supporting it is updated.

SmokeWalletPlatform is required per SmokePredictions tag description: "When selecting SmokePredictions, also select SmokeWalletPlatform (Trending section)."

SmokeConfirmations is required per SmokePredictions tag description: "also select SmokeConfirmations (opening/closing positions are on-chain transactions)."

No app source code was changed, only test infrastructure. Risk is medium because re-enabling a previously skipped test introduces execution risk if the mock fix is incomplete, but the changes are well-scoped and targeted.

Performance Test Selection:
All changes are confined to E2E test infrastructure (mock files and test spec). No app source code, UI components, controllers, or data-loading paths were modified. There is no performance impact to measure.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 4, 2026

Copy link
Copy Markdown

@christopherferreira9 christopherferreira9 added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 9c816ed May 4, 2026
101 checks passed
@christopherferreira9 christopherferreira9 deleted the cferreira/enable-back-predict-test branch May 4, 2026 16:31
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-S team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants