From ec6a406a8d849e71d860ed991350c55b6d49232a Mon Sep 17 00:00:00 2001 From: "fred.tran" Date: Tue, 26 Nov 2024 17:53:24 +0800 Subject: [PATCH] chore: fix /bridge utils test --- .../src/__tests__/{utils.test.ts => utils.test.tsx} | 11 +++++++++++ 1 file changed, 11 insertions(+) rename packages/bridge/src/__tests__/{utils.test.ts => utils.test.tsx} (84%) diff --git a/packages/bridge/src/__tests__/utils.test.ts b/packages/bridge/src/__tests__/utils.test.tsx similarity index 84% rename from packages/bridge/src/__tests__/utils.test.ts rename to packages/bridge/src/__tests__/utils.test.tsx index aa7b7e2..14df912 100644 --- a/packages/bridge/src/__tests__/utils.test.ts +++ b/packages/bridge/src/__tests__/utils.test.tsx @@ -9,6 +9,17 @@ afterEach(() => { vi.mock('@portkey/contracts', () => ({ getContractBasic: vi.fn(), })); +vi.mock('@portkey/did-ui-react', () => ({ + getChainInfo: (c: TChainId) => (!c ? null : {}), + did: { + didWallet: { + managementAccount: { + privateKey: '', + }, + }, + }, + PortkeyProvider: ({ children }: { children: React.ReactNode }) =>
{children}
, +})); describe('getCaContractBase()', () => { it('should throw error about chain is not running', async () => {