From 71208022cb58e709ef39b22aa3d9023aba71c5e2 Mon Sep 17 00:00:00 2001 From: Josh Leonard <30185185+josheleonard@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:29:37 -0600 Subject: [PATCH] chore(wallet): mock all braveWalletP3A methods for storybook and tests (#24952) --- .../common/async/__mocks__/bridge.ts | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/components/brave_wallet_ui/common/async/__mocks__/bridge.ts b/components/brave_wallet_ui/common/async/__mocks__/bridge.ts index fbae53956517..43e46a515cb5 100644 --- a/components/brave_wallet_ui/common/async/__mocks__/bridge.ts +++ b/components/brave_wallet_ui/common/async/__mocks__/bridge.ts @@ -657,11 +657,25 @@ export class MockedWalletApiProxy { } } - braveWalletP3A: Partial< - InstanceType - > = { - reportOnboardingAction: () => {}, - reportJSProvider: () => {} + braveWalletP3A: InstanceType = { + 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<