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: 8618 reduce enzyme usage in unit test by 25 #11658

Open
wants to merge 119 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 30 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 <[email protected]>
@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 21, 2024
Copy link
Contributor

github-actions bot commented Oct 21, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 8eb4852
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3c992c5d-fd7c-45a9-b8fa-a10b544f5bc8

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

brianacnguyen
brianacnguyen previously approved these changes Oct 21, 2024
@Daniel-Cross Daniel-Cross requested a review from a team as a code owner October 22, 2024 13:59
infiniteflower
infiniteflower previously approved these changes Oct 22, 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 22, 2024
Copy link
Contributor

github-actions bot commented Oct 22, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 5a83e43
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e8da0527-309a-47e3-8c71-b4a5038bfa41

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 Oct 22, 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
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

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