test: cv test add perps coverage#30185
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. |
f8885d9 to
9c1ab1c
Compare
9c1ab1c to
5eebaa1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 d51d8fb. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No production app code was changed. The Performance Test Selection: |
|




Description
Adds Perps Component View coverage as part of the E2E to CV migration work. The new coverage focuses on product-visible Perps trading and account-management rules instead of mirroring Detox steps directly.
This PR adds CV tests for:
PerpsOrderView: submitting a market long after reviewing calculated order details; switching to a limit order, using the Mid preset, and routing to TP/SL setup; blocking order submission when the account cannot satisfy the minimum order amount; and routing cross-margin positions to the warning modal instead of placing an order.PerpsCloseAllPositionsView: confirming bulk close for all open positions and ensuring the destructive close action is not exposed when there are no open positions.PerpsCancelAllOrdersView: confirming bulk cancellation for all open orders and ensuring the destructive cancel action is not exposed when there are no open orders.PerpsWithdrawView: showing withdrawal quote details, submitting a max withdrawal, blocking too-small withdrawals with the minimum amount error, and keeping withdrawal unavailable when there is no withdrawable balance.It also extends the Perps CV test framework support with:
PerpsOrderView;Changelog
CHANGELOG entry: null
Related issues
Related: https://consensyssoftware.atlassian.net/browse/MMQA-1723
Manual testing steps
Test-only change. Verified with:
Result:
4test suites passed,11tests passed.Screenshots/Recordings
Not applicable. Test-only change.
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
Low risk since changes are test-only, but they expand shared component-view mocks/presets and renderer providers, which could cause broader test instability if assumptions differ across suites.
Overview
Adds new Perps component-view tests covering key trading/account-management flows: placing orders (market and limit with TP/SL routing), bulk cancelling orders, bulk closing positions, and withdrawals (max/min/zero-balance validation).
Extends the Perps CV test harness to better match runtime dependencies by introducing a shared
PerpsTestProviderswrapper (React Query + hardware wallet context + existing Perps providers), adding arenderPerpsOrderViewrenderer, enhancing stream overrides/controls, and expanding the component-viewEngine/Perps controller mocks plus Perps state preset data needed for confirmation/payment-dependent views.Reviewed by Cursor Bugbot for commit 9a29cd5. Bugbot is set up for automated code reviews on this repo. Configure here.