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

chore: reduce enzyme usage in unit test by 25 - 3 of 3 #11437

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

Daniel-Cross
Copy link
Contributor

Description

This PR replaces the instances where enzyme is used with react-testing-library/react-native across the following tests:

'app/components/Views/EnterPasswordSimple/index.test.tsx',
'app/components/Views/AddBookmark/index.test.tsx',
'app/components/UI/WhatsNewModal/index.test.tsx',
'app/components/UI/SliderButton/index.test.tsx',
'app/components/UI/Screen/index.test.tsx',
'app/components/UI/ReusableModal/index.test.tsx',
'app/components/UI/BlockingActionModal/index.test.tsx',
'app/components/UI/AnimatedTransactionModal/index.test.tsx',
'app/component-library/components/Buttons/Button/variants/ButtonLink/ButtonLink.test.tsx',
'app/components/UI/WarningAlert/WarningAlert.test.tsx',
'app/component-library/components/Texts/Text/Text.test.tsx',
'app/component-library/components/Avatars/Avatar/variants/AvatarIcon/AvatarIcon.test.tsx',
'app/components/Nav/Main/index.test.tsx',
'app/components/UI/SlippageSlider/index.test.tsx',
'app/components/UI/AssetList/index.test.tsx',
'app/components/Views/TransactionsView/index.test.js',
'app/components/Views/PickComponent/index.test.tsx',
'app/components/Approvals/ApprovalModal/ApprovalModal.test.tsx',
'app/components/UI/PaymentRequest/index.test.tsx'

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Daniel-Cross and others added 9 commits September 19, 2024 18:12
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This Pr implements a new navigation flow to notifications enablement.

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**



https://github.com/user-attachments/assets/fe8bed45-e6ca-4945-80df-0ced5dacbd06


<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR is an update to the SDK communication protocol that allows the
following:
- prevent deleting connection until server confirmation
- emit rejection event 

## **Related issues**

- MetaMask/metamask-sdk#1020
- MetaMask/metamask-sdk#1022

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

In this pull request, I have integrated extensive analytics tracking
across various components and functionalities. This includes adding
events for enabling and disabling basic functionality, profile syncing,
and notifications. Additionally, I have implemented tracking for user
interactions with notifications, such as opening the notifications menu,
marking notifications as read, and clicking on notification details.

## **Related issues**

N/A

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

N/A

### **Before**

N/A

### **After**

N/A

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.

---------

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
@Daniel-Cross Daniel-Cross linked an issue Sep 25, 2024 that may be closed by this pull request
9 tasks
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.

@Daniel-Cross Daniel-Cross self-assigned this Sep 25, 2024
@Daniel-Cross Daniel-Cross added the Run Smoke E2E Triggers smoke e2e on Bitrise label Sep 25, 2024
Copy link
Contributor

github-actions bot commented Sep 25, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 436ad9a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e3033eaf-06a8-4d5f-8f04-5b28a1994278

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

@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 1, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 941cdab
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/32e07d4a-a47f-4d2c-b2e9-38fbc024c39a

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

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Daniel-Cross Daniel-Cross marked this pull request as ready for review October 1, 2024 14:33
@Daniel-Cross Daniel-Cross requested review from a team as code owners October 1, 2024 14:33
@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 1, 2024
@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 1, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ee7f5a5
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1a9d6ea4-34af-4156-9c36-4d8e9cbc76a7

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

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 5caa0d2
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/21fddb2e-b6b0-419c-82b8-5e4cc3cfe11a

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

@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 2, 2024
@Daniel-Cross Daniel-Cross requested a review from a team as a code owner October 3, 2024 06:25
Copy link

sonarcloud bot commented Oct 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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