From c66d1aceeecb5b19b2ee5b72ab28bfc8bca52821 Mon Sep 17 00:00:00 2001 From: Florin Dzeladini Date: Wed, 20 Nov 2024 09:28:03 +0100 Subject: [PATCH] fix: test suits --- packages/starknet-snap/src/index.test.tsx | 26 ----------------------- 1 file changed, 26 deletions(-) diff --git a/packages/starknet-snap/src/index.test.tsx b/packages/starknet-snap/src/index.test.tsx index e905ac12..236eab98 100644 --- a/packages/starknet-snap/src/index.test.tsx +++ b/packages/starknet-snap/src/index.test.tsx @@ -3,7 +3,6 @@ import { text, MethodNotFoundError, SnapError } from '@metamask/snaps-sdk'; import { onHomePage, onRpcRequest } from '.'; import * as createAccountApi from './createAccount'; import { HomePageController } from './on-home-page'; -import { InitSnapStateManager } from './state/init-snap-state-manager'; import * as keyPairUtils from './utils/keyPair'; jest.mock('./utils/logger'); @@ -16,15 +15,9 @@ jest.mock('./utils', () => ({ describe('onRpcRequest', () => { const createMockSpy = () => { - const requireMetaMaskUpgradeSpy = jest.spyOn( - InitSnapStateManager.prototype, - 'requireMetaMaskUpgrade', - ); - requireMetaMaskUpgradeSpy.mockResolvedValue(false); const createAccountSpy = jest.spyOn(createAccountApi, 'createAccount'); const keyPairSpy = jest.spyOn(keyPairUtils, 'getAddressKeyDeriver'); return { - requireMetaMaskUpgradeSpy, createAccountSpy, keyPairSpy, }; @@ -67,20 +60,6 @@ describe('onRpcRequest', () => { ).rejects.toThrow(MethodNotFoundError); }); - it('throws `SnapError` on request if MetaMask needs update', async () => { - const { requireMetaMaskUpgradeSpy } = createMockSpy(); - requireMetaMaskUpgradeSpy.mockResolvedValue(true); - await expect( - onRpcRequest({ - ...createMockRequest(), - request: { - ...createMockRequest().request, - method: 'executeTxn', - }, - }), - ).rejects.toThrow(SnapError); - }); - it('requests gets executed if MetaMask does not needs update', async () => { createMockSpy(); expect( @@ -111,11 +90,6 @@ describe('onRpcRequest', () => { describe('onHomePage', () => { it('executes homePageController normally if jsxSupport is not required', async () => { - const requireMetaMaskUpgradeSpy = jest.spyOn( - InitSnapStateManager.prototype, - 'requireMetaMaskUpgrade', - ); - requireMetaMaskUpgradeSpy.mockResolvedValue(false); const executeSpy = jest.spyOn(HomePageController.prototype, 'execute'); executeSpy.mockResolvedValue({ content: text('test') });