test: Added missing component test scenarios for perps area#25889
test: Added missing component test scenarios for perps area#25889javiergarciavera merged 29 commits intomainfrom
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. |
app/components/UI/Perps/Views/PerpsClosePositionView/PerpsClosePositionView.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Perps/Views/PerpsClosePositionView/PerpsClosePositionView.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Perps/Views/PerpsMarketListView/PerpsMarketListView.view.test.tsx
Show resolved
Hide resolved
...ponents/UI/Perps/Views/PerpsSelectModifyActionView/PerpsSelectModifyActionView.view.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Perps/components/PerpsModifyActionSheet/PerpsModifyActionSheet.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Perps/Views/PerpsMarketDetailsView/PerpsMarketDetailsView.view.test.tsx
Show resolved
Hide resolved
...ponents/UI/Perps/Views/PerpsSelectModifyActionView/PerpsSelectModifyActionView.view.test.tsx
Outdated
Show resolved
Hide resolved
...ponents/UI/Perps/Views/PerpsSelectModifyActionView/PerpsSelectModifyActionView.view.test.tsx
Show resolved
Hide resolved
...ponents/UI/Perps/Views/PerpsSelectModifyActionView/PerpsSelectModifyActionView.view.test.tsx
Show resolved
Hide resolved
app/components/UI/Perps/Views/PerpsSelectOrderTypeView/PerpsSelectOrderTypeView.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Perps/Views/PerpsMarketListView/PerpsMarketListView.view.test.tsx
Show resolved
Hide resolved
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Key observations:
Since no production code is changed and these are purely unit test additions, E2E tests are not needed to validate these changes. The unit tests themselves will verify the test infrastructure works correctly when they run. Performance Test Selection: |
|



Description
Perps tab: regression tests, geo-restriction, and test/lint fixes
Bug regression (7.64 EXP):
PerpsTabView: “See all perps” navigates to market list (not perps home); Explore includes all categories (crypto, stocks, forex, commodities) and commodities are not filtered; clear separation between discoverable markets and positions/orders.
PerpsMarketListView: Market list shows all categories, including commodities when present.
Geo-restriction (compliance):
PerpsClosePositionView: Uses selectPerpsEligibility; confirm disabled and geo-block tooltip when not eligible; handleConfirm does not close position when ineligible.
PerpsSelectModifyActionView: Same eligibility check for reduce/add/flip actions; ineligible users see geo-block tooltip and do not navigate.
Tests only (no component/UI changes):
PerpsTabView: Connection state tests (connected / disconnected / loading) for control bar and scroll behavior; strengthened “explore when no positions/orders” test with copy checks.
Other:
perpsStateMock: PerpsController.isEligible: true by default for tests.
ESLint: Patch applied for deprecated @typescript-eslint/no-parameter-properties; fixed no-shadow in PerpsMarketListView.test.tsx mock (use ReactActual).
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Test-only changes plus additional Engine mocking used in view tests; low product risk but could affect test reliability if the new Perps stubs diverge from real controller behavior.
Overview
Adds Perps component view-test coverage and supporting test infrastructure.
Introduces new view tests for
PerpsTabView,PerpsMarketListView,PerpsMarketDetailsView, andPerpsSelectModifyActionViewto lock in regressions around “See all perps” navigation, market category filtering/badges, and geo-restriction behavior (show geo-block bottom sheet on Close/Modify). To make these tests state-driven, it adds aninitialStatePerpspreset, aperpsViewRendererthat wires Perps connection/stream providers with controllable stream overrides and optional extra routes, plus PerpsController Engine stubs and small typing/docs updates to the component-view test framework.Written by Cursor Bugbot for commit 5604bbf. This will update automatically on new commits. Configure here.