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: add unit test for get-starknet event #490

Conversation

khanti42
Copy link
Collaborator

@khanti42 khanti42 commented Jan 21, 2025

This PR is to add the unit test for get-starknet event

Changes:

  • having a MockMetaMaskSnapWallet to extends MetaMaskSnapWallet and override some properties to allow spy
  • adding test accountChanged / networkChanged event
  • changing the modifier of properties pollingTimeoutMs and pollingDelayMs in MetaMaskSnapWallet to protected, which to enable MockMetaMaskSnapWallet to mock it

@khanti42 khanti42 requested a review from a team as a code owner January 21, 2025 00:09
@khanti42 khanti42 requested review from Julink-eth and wantedsystem and removed request for a team January 21, 2025 00:09
packages/get-starknet/src/wallet.ts Outdated Show resolved Hide resolved
packages/get-starknet/src/wallet.test.ts Outdated Show resolved Hide resolved
packages/get-starknet/src/wallet.test.ts Outdated Show resolved Hide resolved
packages/get-starknet/src/wallet.test.ts Outdated Show resolved Hide resolved
packages/get-starknet/src/wallet.test.ts Outdated Show resolved Hide resolved
packages/get-starknet/src/wallet.test.ts Outdated Show resolved Hide resolved
packages/get-starknet/src/wallet.test.ts Outdated Show resolved Hide resolved
packages/get-starknet/src/wallet.ts Show resolved Hide resolved
Base automatically changed from feat/account-event-change-get-starknet to feat/enable-multiple-accounts January 22, 2025 02:28
Copy link
Collaborator

@stanleyyconsensys stanleyyconsensys left a comment

Choose a reason for hiding this comment

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

LGTM

@stanleyyconsensys stanleyyconsensys merged commit c233cc8 into feat/enable-multiple-accounts Jan 24, 2025
3 checks passed
@stanleyyconsensys stanleyyconsensys deleted the feat/account-event-change-get-starknet-unittest branch January 24, 2025 03:18
Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
4.4% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
17 New issues
0 Accepted issues

Measures
0 Security Hotspots
2.0% Coverage on New Code
0.6% Duplication on New Code

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants