-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(trading): delete suite-analytics #17459
Conversation
WalkthroughThe changes remove the dependency on the ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🚀 Expo preview is ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌 Looks good and mobile app builds again. Good job. Just a one tiny nit
960f5d7
to
47d50cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
suite-common/trading/src/thunks/buy/__tests__/confirmTradeThunk.test.ts (2)
48-48
: Fix naming convention inconsistency.The mock function name should follow camelCase convention like other mock functions in the file.
-const mocktriggerAnalyticsTradeConfirmation = jest.fn(); +const mockTriggerAnalyticsTradeConfirmation = jest.fn();
64-64
: Update mock function reference to match new name.If you update the function name as suggested above, you'll need to update this reference as well.
-mocktriggerAnalyticsTradeConfirmation, +mockTriggerAnalyticsTradeConfirmation,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (4)
suite-common/trading/package.json
(0 hunks)suite-common/trading/src/thunks/buy/__tests__/confirmTradeThunk.test.ts
(12 hunks)suite-common/trading/src/thunks/buy/confirmTradeThunk.ts
(2 hunks)suite-common/trading/tsconfig.json
(0 hunks)
💤 Files with no reviewable changes (2)
- suite-common/trading/package.json
- suite-common/trading/tsconfig.json
⏰ Context from checks skipped due to timeout of 90000ms (15)
- GitHub Check: PR-check / node-authorizeCoinjoin cancelCoinjoinAuthorization passphrase unlockPath setBusy checkFirmwareAuthenticity keepSession cancel.test info.test resetDevice-api
- GitHub Check: PR-check / node-override init-api-flaky
- GitHub Check: PR-check / web-authorizeCoinjoin cancelCoinjoinAuthorization passphrase unlockPath setBusy checkFirmwareAuthenticity keepSession cancel.test info.test resetDevice-api
- GitHub Check: PR-check / web-override init-api-flaky
- GitHub Check: build-deploy
- GitHub Check: build-deploy
- GitHub Check: EAS Update
- GitHub Check: test
- GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
- GitHub Check: transport-e2e-test
- GitHub Check: build-web
- GitHub Check: Setup and Cache Dependencies
- GitHub Check: prepare_android_test_app
- GitHub Check: Analyze with CodeQL (javascript)
- GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (7)
suite-common/trading/src/thunks/buy/confirmTradeThunk.ts (3)
18-18
: Good addition of a function callback for analytics.Adding a callback function for analytics reporting is a cleaner approach that decouples the trading module from the suite-analytics dependency, making it compatible with suite-native as intended by the PR.
25-31
: Clean and well-structured function signature update.The function signature has been properly updated to include the new callback parameter, maintaining consistent code style with proper destructuring.
40-40
: Good replacement of direct analytics usage with callback.The analytics reporting is now handled through the callback function, successfully removing the direct dependency on suite-analytics while maintaining the same functionality.
suite-common/trading/src/thunks/buy/__tests__/confirmTradeThunk.test.ts (4)
70-91
: Well-structured test update for the no-action case.The test case has been properly updated to use the new analytics trigger callback and verify it's not called when selectedQuote is not set.
97-126
: Good test update for error handling when there's no response.The test correctly verifies that the analytics trigger is called once even in error scenarios, which maintains consistent tracking.
129-196
: Consistent test updates for all error scenarios.All error case tests have been updated properly to use the new callback approach, ensuring thorough test coverage of the refactored code.
238-284
: Good update to the success case test.The test properly verifies that the analytics trigger is called once in the success scenario, and all other assertions remain intact.
Description
Deleted suite-analytics from trading - not compatible with suite-native