-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
TokenDetectionController: Write comprehensive unit tests #1615
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Hey team! Please add your planning poker estimate with Zenhub @Gudahtt @kanthesha @MajorLift @mcmire @mikesposito |
…h `DetectTokensController` (#3867) ## Explanation - This PR adds unit tests for the token-detection-controller API changes implemented in #3775. - The following changes are covered in the new tests: - Don't detect if keyring-controller `isUnlocked` state is false. - Subscribe to `KeyringController:unlock`, `KeyringController:lock` events - Subscribe to `AccountsController:selectedAccountChange` event - Detect tokens using `@metamask/contract-metadata` static token list if on mainnet and `useTokenDetection` is false. - Call `trackMetaMetricsEvent` for every detected token. - The aim of this PR isn't to achieve 100% test coverage for token-detection-controller. That will be the goal of follow-up ticket #1615 ## References - Closes #3626 - Follows from: - #3775 - #3690 - Followed by #1615 ## Changelog N/A ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
The scope of this ticket no longer includes the API changes caused by the consolidation with However, it needs to update the tests in the extension |
|
We should review the tests for TokenDetectionController and ensure that the functionality and edge cases are well-covered by tests and that there are no duplicative or unnecessary tests. A new contributor should be able to use the tests as a guideline for what the controller does.
There were API changes made recently to TokenDetectionController, so we should focus on backfilling tests for those especially.This is no longer the case, but see comments below for updates.The text was updated successfully, but these errors were encountered: