metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

test: Assert accounts are removed with snap removal in existing test

Open plasmacorral opened this issue 9 months ago • 6 comments

Description

Updating existing test to confirm that accounts are removed when the snap is removed

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/accounts-planning/issues/439

Manual testing steps

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.

plasmacorral avatar May 08 '24 20:05 plasmacorral

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.

github-actions[bot] avatar May 08 '24 20:05 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.37%. Comparing base (4cf7e80) to head (4bfd166).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #24442   +/-   ##
========================================
  Coverage    67.37%   67.37%           
========================================
  Files         1289     1289           
  Lines        50220    50220           
  Branches     13005    13005           
========================================
  Hits         33835    33835           
  Misses       16385    16385           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 08 '24 21:05 codecov[bot]

Builds ready [638b002]
Page Load Metrics (359 ± 419 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7013887189
domContentLoaded94415105
load583323359872419
domInteractive94415105
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar May 08 '24 21:05 metamaskbot

Could we include more assertions based on the specific account that was added? Otherwise, it looks good.

hjetpoluru avatar May 09 '24 20:05 hjetpoluru

Could we include more assertions based on the specific account that was added?

Thank you, @hjetpoluru! Yes, we could. Are you suggesting to add assertions to confirm that the created account address is what we expect?

Bear in mind the snap simple keyring (SSK) does create a unique private key on any new account creation. In these tests we are not expecting a specific account address, rather just some public address derived from the private key that was created. Verifying the address that was added in the accounts list would certainly be beneficial if we were testing the import of a known private key through SSK, but here we are a creating new random private key.

plasmacorral avatar May 09 '24 20:05 plasmacorral

Yes, I totally agree with you that the address is dynamically created, and it's validated in the creation of the account in another test.

hjetpoluru avatar May 09 '24 21:05 hjetpoluru

Builds ready [40bcb35]
Page Load Metrics (1181 ± 660 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint73162932110
domContentLoaded10361684
load61318411811374660
domInteractive10361684
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar May 20 '24 12:05 metamaskbot

Builds ready [4bfd166]
Page Load Metrics (1916 ± 609 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint854051397436
domContentLoaded109821199
load71427119161269609
domInteractive109821199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar May 20 '24 12:05 metamaskbot

Merge this PR as Mike's OOO.

chloeYue avatar May 20 '24 12:05 chloeYue