Skip to content

test: fix: ppom-middleware tests#23745

Merged
digiwand merged 8 commits intodevelopfrom
test-fix-ppom-middleware-tests
Mar 27, 2024
Merged

test: fix: ppom-middleware tests#23745
digiwand merged 8 commits intodevelopfrom
test-fix-ppom-middleware-tests

Conversation

@digiwand
Copy link
Copy Markdown
Contributor

@digiwand digiwand commented Mar 26, 2024

Description

Fix and update ppom-middleware tests

Fix:

  • test with usePPOM did not test expected thown error
    • great find by @cryptotavares
    • test was throwing an unexpected error rather than the thrown error in the mocked method
    • the error was passing the usePPOM param as an object rather than a promise
  • validation test did not test validation, but rather loading. Updated test to reflect testing loading
  • added validation test
  • test to check non-supported network was faulty
    • updated phrase to mention non-supported networks rather than non-eth-mainnet networks
    • removed securityProviderEnabled: false check, which blocked the test from testing

Updates:

  • remove "should" prefix from test phrases
  • updates createMiddleware helper method to use an options param for optional parameters

Related issues

Fixes: #23571
Related to: #23480

Manual testing steps

  1. yarn jest app/scripts/lib/ppom/ppom-middleware.test.ts

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • 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.

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.

@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.

@digiwand digiwand marked this pull request as ready for review March 26, 2024 20:28
@digiwand digiwand requested a review from a team as a code owner March 26, 2024 20:28
@digiwand digiwand changed the title test:fix: ppom-middleware tests test: fix: ppom-middleware tests Mar 26, 2024
@digiwand digiwand added the team-confirmations-secure-ux-PR PRs from the confirmations team label Mar 26, 2024
@digiwand digiwand merged commit 73ee522 into develop Mar 27, 2024
@digiwand digiwand deleted the test-fix-ppom-middleware-tests branch March 27, 2024 13:16
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2024
@metamaskbot metamaskbot added the release-11.15.0 Issue or pull request that will be included in release 11.15.0 label Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.15.0 Issue or pull request that will be included in release 11.15.0 team-confirmations-secure-ux-PR PRs from the confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: If a bug is thrown in ppom-validator, the user may experience an infinite spinner

4 participants