Skip to content

fix: (#8617): Reduce enzyme usage in unit test by 25% - [2/3] (#8823)#9001

Merged
Cal-L merged 6 commits into
mainfrom
fix/8617-reduce-enzyme-by-25-2/3
Mar 21, 2024
Merged

fix: (#8617): Reduce enzyme usage in unit test by 25% - [2/3] (#8823)#9001
Cal-L merged 6 commits into
mainfrom
fix/8617-reduce-enzyme-by-25-2/3

Conversation

@Cal-L

@Cal-L Cal-L commented Mar 19, 2024

Copy link
Copy Markdown
Contributor

Description

Convert the list of unit tests to use react-testing-library instead of enzyme for the following files:

This merges the original PR from @timi-codes for enzyme reduction - #8823

'app/components/UI/ActionView/index.test.tsx',
'app/components/UI/ActionModal/index.test.tsx',

'app/components/Views/confirmations/components/CustomNonce/index.test.tsx',

'app/components/Views/confirmations/SendFlow/ErrorMessage/index.test.tsx',

'app/components/Views/Settings/Contacts/AmbiguousAddressSheet/AmbiguousAddressSheet.test.tsx',

'app/components/Views/confirmations/components/Approval/ApprovalFlowLoader/index.test.tsx',
'app/components/UI/ImageIcon/index.test.tsx',
'app/components/UI/FadeOutOverlay/index.test.tsx',
'app/components/UI/AssetIcon/index.test.tsx',
'app/components/UI/TimeEstimateInfoModal/index.test.tsx',
'app/components/UI/Tabs/index.test.tsx',
'app/components/UI/ModalNavbarTitle/index.test.tsx',
'app/components/Views/WalletConnectSessions/index.test.tsx',
'app/component-library/components/Tags/Tag/Tag.test.tsx',
'app/components/UI/SwitchCustomNetwork/index.test.tsx',

'app/component-library/components/Avatars/Avatar/variants/AvatarAccount/AvatarAccount.test.tsx',
'app/components/Views/ImportPrivateKey/index.test.tsx'

Related issues

Fixes: #8617

Manual testing steps

Not Applicable

Screenshots/Recordings

Not Applicable

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Description

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

## **Description**

Convert the list of unit tests to use react-testing-library instead of
enzyme for the following files:

  ```
  'app/components/UI/ActionView/index.test.tsx',
  'app/components/UI/ActionModal/index.test.tsx',

'app/components/Views/confirmations/components/CustomNonce/index.test.tsx',

'app/components/Views/confirmations/SendFlow/ErrorMessage/index.test.tsx',

'app/components/Views/Settings/Contacts/AmbiguousAddressSheet/AmbiguousAddressSheet.test.tsx',

'app/components/Views/confirmations/components/Approval/ApprovalFlowLoader/index.test.tsx',
  'app/components/UI/ImageIcon/index.test.tsx',
  'app/components/UI/FadeOutOverlay/index.test.tsx',
  'app/components/UI/AssetIcon/index.test.tsx',
  'app/components/UI/TimeEstimateInfoModal/index.test.tsx',
  'app/components/UI/Tabs/index.test.tsx',
  'app/components/UI/ModalNavbarTitle/index.test.tsx',
  'app/components/Views/WalletConnectSessions/index.test.tsx',
  'app/component-library/components/Tags/Tag/Tag.test.tsx',
  'app/components/UI/SwitchCustomNetwork/index.test.tsx',

'app/component-library/components/Avatars/Avatar/variants/AvatarAccount/AvatarAccount.test.tsx',
  'app/components/Views/ImportPrivateKey/index.test.tsx'
```

## **Related issues**

Fixes: #8617 

## **Manual testing steps**

Not Applicable

## **Screenshots/Recordings**

Not Applicable

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it is solved.
- [x] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
  - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
@Cal-L Cal-L requested a review from a team as a code owner March 19, 2024 21:07
@github-actions

Copy link
Copy Markdown
Contributor

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.

@Cal-L Cal-L added team-mobile-platform Mobile Platform team No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E labels Mar 19, 2024
@github-actions

github-actions Bot commented Mar 19, 2024

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: d9c5e22
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/432dd9c7-c16b-4115-b1b3-602f13629fc3

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions

github-actions Bot commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: bbe794a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9d9e0f89-d94a-4504-b3f2-3b8ca85559a3

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@codecov-commenter

codecov-commenter commented Mar 20, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 45.60%. Comparing base (04e35fb) to head (bbe794a).

Files Patch % Lines
...ents/Views/Settings/ExperimentalSettings/index.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9001      +/-   ##
==========================================
+ Coverage   45.56%   45.60%   +0.03%     
==========================================
  Files        1275     1275              
  Lines       31169    31169              
  Branches     3182     3182              
==========================================
+ Hits        14202    14214      +12     
+ Misses      16126    16114      -12     
  Partials      841      841              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

Copy link
Copy Markdown

@tommasini tommasini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Cal-L Cal-L merged commit f94ec69 into main Mar 21, 2024
@Cal-L Cal-L deleted the fix/8617-reduce-enzyme-by-25-2/3 branch March 21, 2024 16:49
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 21, 2024
@metamaskbot metamaskbot added the release-7.20.0 Issue or pull request that will be included in release 7.20.0 label Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

external-contributor No QA Needed Apply this label when your PR does not need any QA effort. release-7.20.0 Issue or pull request that will be included in release 7.20.0 team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce enzyme usage in unit test by 25% - [2 of 3]

5 participants