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

Merged

Conversation

Daniel-Cross
Copy link
Contributor

@Daniel-Cross Daniel-Cross commented Oct 7, 2024

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 <prithpal.sooriya@consensys.net>
@Daniel-Cross Daniel-Cross added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 1, 2024
Copy link
Contributor

github-actions bot commented Nov 1, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: fed27ff
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/95f0a991-849d-46f7-9782-d0e19501a9ee

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 Nov 4, 2024
Copy link
Contributor

github-actions bot commented Nov 4, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 43868e6
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/080202ff-58c9-45a4-9aab-c8471b5131a0

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 Nov 5, 2024
Copy link
Contributor

github-actions bot commented Nov 5, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 39b643f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7e786ef4-6979-4009-87db-c5c63a15f880

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

sonarqubecloud bot commented Nov 5, 2024

@sethkfman sethkfman added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 5, 2024
Copy link
Contributor

github-actions bot commented Nov 5, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 167af4d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3a789885-1b44-4312-aa19-cc67323b3491

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

Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

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

LGTM

@sethkfman sethkfman disabled auto-merge November 6, 2024 00:29
@sethkfman sethkfman enabled auto-merge November 6, 2024 00:31
@sethkfman sethkfman disabled auto-merge November 6, 2024 00:31
@sethkfman sethkfman added this pull request to the merge queue Nov 6, 2024
Merged via the queue into main with commit d112027 Nov 6, 2024
42 of 43 checks passed
@sethkfman sethkfman deleted the chore-8618-reduce-enzyme-usage-in-unit-test-by-25---3-of-3 branch November 6, 2024 00:56
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2024
@gauthierpetetin gauthierpetetin added the release-7.36.0 Issue or pull request that will be included in release 7.36.0 label Nov 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.36.0 Issue or pull request that will be included in release 7.36.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 by 25% - [3 of 3]