test: fix ff default value#31070
Conversation
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Impact Assessment:
Why SmokeWalletPlatform only:
No performance tests needed: This is a pure test infrastructure change with no impact on app rendering, data loading, or runtime performance. Performance Test Selection: |
Description
This PR makes the E2E remote feature-flag mock deterministic for the homepage
trending-sections A/B test.
The flaky behavior came from
setupRemoteFeatureFlagsMock(mockServer, {})serving the production registry defaults. For
homeTMCU470AbtestTrendingSections, the production default is a percentagerollout array, not a fixed
controlvalue.RemoteFeatureFlagControllerresolves that rollout at runtime using a deterministic threshold based on:
That means the same build and the same mocked feature-flag endpoint can still
render different homepage UI if the runtime analytics ID differs:
controlrenders the regularPerpetualssection.trendingSectionsrenders the separateTrending perpetualssection.The fix pins
homeTMCU470AbtestTrendingSectionstocontrolin the sharedE2E-safe mock defaults. Individual tests can still explicitly opt into
trendingSectionsby passing an override tocreateRemoteFeatureFlagsMockorsetupRemoteFeatureFlagsMock.Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Verified with:
Result:
1test suite passed,23tests passed.Screenshots/Recordings
Not applicable. Test-only change.
Before
E2E default feature-flag mocks could return the production rollout array for
homeTMCU470AbtestTrendingSections, allowing runtime analytics ID bucketing tochoose either homepage variant.
After
E2E default feature-flag mocks pin
homeTMCU470AbtestTrendingSectionstocontrol, so existing specs continue to see thePerpetualssection unless aspec explicitly overrides the variant.
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Test-only changes to API-mocking defaults; no production app or auth logic.
Overview
E2E remote feature-flag mocks now pin
homeTMCU470AbtestTrendingSectionstocontrolinE2E_SAFE_DEFAULTS, alongside existing safe defaults likemobileMinimumVersions. Production’s percentage rollout made homepage section labels depend on the generated analytics ID; pinning keeps API-mocked E2E runs deterministic.Two unit tests assert the default mock includes
controland thatcreateRemoteFeatureFlagsMock({ homeTMCU470AbtestTrendingSections: 'trendingSections' })still overrides the pin.Reviewed by Cursor Bugbot for commit 50d4df1. Bugbot is set up for automated code reviews on this repo. Configure here.