Skip to content

Commit

Permalink
chore(wallet): mock all braveWalletP3A methods for storybook and tests (
Browse files Browse the repository at this point in the history
  • Loading branch information
josheleonard authored Aug 1, 2024
1 parent e4ed629 commit 7120802
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions components/brave_wallet_ui/common/async/__mocks__/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,11 +657,25 @@ export class MockedWalletApiProxy {
}
}

braveWalletP3A: Partial<
InstanceType<typeof BraveWallet.BraveWalletP3AInterface>
> = {
reportOnboardingAction: () => {},
reportJSProvider: () => {}
braveWalletP3A: InstanceType<typeof BraveWallet.BraveWalletP3AInterface> = {
reportOnboardingAction: (action) => {
console.log(`reporting onboarding action: ${action}`)
},
reportJSProvider: (providerType, coinType, allowProviderOverwrite) => {
console.log(
`reporting JS provider: ${JSON.stringify(
{ providerType, coinType, allowProviderOverwrite },
undefined,
2
)}`
)
},
recordActiveWalletCount(count, coinType) {
console.log(`active wallet count: ${count} for ${coinType}`)
},
recordNFTGalleryView(nftCount) {
console.log(`viewing nft gallery with ${nftCount} nfts`)
}
}

assetRatioService: Partial<
Expand Down

0 comments on commit 7120802

Please sign in to comment.