Skip to content
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

Migrate another (3/3) batch of unit tests away from enzyme #8959

Merged
merged 22 commits into from
Mar 20, 2024

Conversation

kylanhurt
Copy link
Contributor

@kylanhurt kylanhurt commented Mar 15, 2024

Description

The mobile platform team is pushing to reduce the usage of enzyme within the application. This PR puts us one step closer to accomplishing this goal. This batch includes the following files:

'app/components/UI/LedgerModals/LedgerMessageSignModal.test.tsx',
  'app/components/UI/GlobalAlert/index.test.tsx',
  'app/components/UI/BrowserBottomBar/index.test.tsx',
  'app/component-library/components/Buttons/ButtonIcon/ButtonIcon.test.tsx',
  'app/components/Nav/App/index.test.tsx',
  'app/components/Views/OfflineMode/index.test.tsx',
  'app/components/Views/LockScreen/index.test.tsx',
  'app/components/UI/SearchTokenAutocomplete/index.test.tsx',
  'app/components/UI/OptinMetrics/index.test.tsx',
  'app/components/UI/AccountRightButton/index.test.tsx',
  'app/components/UI/AccountOverview/index.test.tsx',
  'app/component-library/components/Pickers/PickerAccount/PickerAccount.test.tsx',
  'app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.test.tsx',
  'app/component-library/components/Buttons/Button/variants/ButtonPrimary/ButtonPrimary.test.tsx',
  'app/components/Views/QRScanner/index.test.tsx',
  'app/components/Views/ImportFromSecretRecoveryPhrase/index.test.tsx',
  'app/components/Views/AccountBackupStep1/index.test.tsx',
  'app/components/UI/AssetSearch/index.test.tsx',
  'app/components/Views/Settings/NetworksSettings/index.test.tsx'

Related issues

Fixes: #8805

Manual testing steps

yarn test:unit

Screenshots/Recordings

image

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.
  • [X 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.

Copy link
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.

@kylanhurt kylanhurt marked this pull request as ready for review March 15, 2024 16:33
@kylanhurt kylanhurt requested review from a team as code owners March 15, 2024 16:33
@github-actions github-actions bot added the Run Smoke E2E Triggers smoke e2e on Bitrise label Mar 15, 2024
Copy link
Contributor

github-actions bot commented Mar 15, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 31c3ccd
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1afda4d9-6a2e-433f-92dc-ed8a56c6665f

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
Copy link

codecov-commenter commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.49%. Comparing base (82a4668) to head (b448e5f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8959      +/-   ##
==========================================
+ Coverage   43.77%   45.49%   +1.72%     
==========================================
  Files        1274     1274              
  Lines       31126    31126              
  Branches     3168     3168              
==========================================
+ Hits        13624    14162     +538     
+ Misses      16689    16125     -564     
- Partials      813      839      +26     

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

@NicolasMassart NicolasMassart added team-mobile-platform needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Mar 15, 2024
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Nice work!
I added some suggestions but your updates are already going to change our life when testing.

@kylanhurt kylanhurt requested a review from a team as a code owner March 18, 2024 14:07
NicolasMassart
NicolasMassart previously approved these changes Mar 18, 2024
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for making the tests easier!

brianacnguyen
brianacnguyen previously approved these changes Mar 18, 2024
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

Left some comments

app/components/UI/AccountRightButton/index.test.tsx Outdated Show resolved Hide resolved
app/components/UI/OptinMetrics/index.test.tsx Outdated Show resolved Hide resolved
app/components/Views/LockScreen/index.test.tsx Outdated Show resolved Hide resolved
app/components/Views/OfflineMode/index.test.tsx Outdated Show resolved Hide resolved
app/components/Views/QRScanner/index.test.tsx Outdated Show resolved Hide resolved
@kylanhurt kylanhurt requested a review from a team as a code owner March 19, 2024 16:04
@kylanhurt kylanhurt added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 19, 2024
Copy link
Contributor

github-actions bot commented Mar 19, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: bc808cc
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/906a14a1-00d7-4a4c-be7a-63951012608a

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

Copy link
Contributor

@Cal-L Cal-L left a comment

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 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 19, 2024
Copy link
Contributor

github-actions bot commented Mar 19, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: b448e5f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f679e1ec-b7a9-4894-ad7c-01a2f75890eb

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

Copy link

sonarcloud bot commented Mar 19, 2024

Copy link
Contributor

@Cal-L Cal-L left a comment

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 04e35fb into main Mar 20, 2024
32 of 35 checks passed
@Cal-L Cal-L deleted the kylan/tests-batch-3 branch March 20, 2024 01:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Mar 20, 2024
@metamaskbot metamaskbot added the release-7.20.0 Issue or pull request that will be included in release 7.20.0 label Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.20.0 Issue or pull request that will be included in release 7.20.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Reduce enzyme usage in unit test down to 50% - [3 of 3]
6 participants