MetaMask / MetaMask/metamask-extension
Improvement: fix warnings in unit test and lint
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
There are some function-level warnings that require more than a simple fix, they are really useful indicators to identify issues in our implementation. Hence it is more appropriate to look into the code base and see any potential refactors could be done.
In general there are 3 sections worth attention that has not been covered by a merged [PR](https://github.com/MetaMask/metamask-extension/pull/17567):
1. `Warning: An update to NetworksForm inside a test was not wrapped in act(...).`
And the following files needs fix
```
ui/pages/settings/networks-tab/networks-form/networks-form.test.js
ui/pages/settings/networks-tab/networks-tab-content/networks-tab-content.test.js
ui/pages/settings/networks-tab/networks-tab.test.js
ui/components/app/collectible-details/collectible-details.js
ui/pages/token-details/token-details-page.test.js
```
2. `Warning: componentWillReceiveProps has been renamed, and is not recommended for use. `
where they would need an update of lifecycle method
```
ui/pages/onboarding-flow/onboarding-flow.test.js
ui/pages/swaps/build-quote/build-quote.test.js
ui/pages/swaps/slippage-buttons/slippage-buttons.test.js
ui/pages/onboarding-flow/privacy-settings/privacy-settings.test.js
ui/pages/first-time-flow/seed-phrase/seed-phrase.test.js
ui/pages/settings/settings-tab/settings-tab.test.js
ui/pages/settings/advanced-tab/advanced-tab.component.test.js
ui/pages/settings/alerts-tab/alerts-tab.test.js
ui/pages/settings/settings.test.js
ui/pages/settings/experimental-tab/experimental-tab.test.js
ui/pages/settings/security-tab/security-tab.test.js
```
3. Assertion error
```
app/scripts/lib/account-tracker.test.js
```
4. Last but not least, we need to respect dependencies in hooks
```
ui/components/ui/actionable-message/actionable-message.js
ui/contexts/metametrics.js
ui/pages/confirm-signature-request/index.js
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the unit-test and lint commands, then inspect the listed test files and implementation files such as ui/components/ui/actionable-message/actionable-message.js and app/scripts/lib/account-tracker.test.js. Group the reported warnings by section and confirm each listed location. Done means the relevant warnings and assertion error are resolved without introducing new test or lint failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100