diff --git a/app/scripts/controllers/transactions/EtherscanRemoteTransactionSource.test.ts b/app/scripts/controllers/transactions/EtherscanRemoteTransactionSource.test.ts index ea3c3d59f602..6fbf52246e29 100644 --- a/app/scripts/controllers/transactions/EtherscanRemoteTransactionSource.test.ts +++ b/app/scripts/controllers/transactions/EtherscanRemoteTransactionSource.test.ts @@ -3,7 +3,6 @@ import { TransactionStatus, TransactionType, } from '../../../../shared/constants/transaction'; -import createRandomId from '../../../../shared/modules/random-id'; import type { EtherscanTokenTransactionMeta, EtherscanTransactionMeta, @@ -24,6 +23,9 @@ jest.mock('./etherscan', () => ({ jest.mock('../../../../shared/modules/random-id'); const ID_MOCK = '123'; +jest.mock('uuid', () => ({ + v4: jest.fn(() => ID_MOCK), +})); const ETHERSCAN_TRANSACTION_BASE_MOCK: EtherscanTransactionMetaBase = { blockNumber: '4535105', @@ -135,8 +137,6 @@ describe('EtherscanRemoteTransactionSource', () => { typeof fetchEtherscanTokenTransactions >; - const createIdMock = createRandomId as jest.MockedFn; - beforeEach(() => { jest.resetAllMocks(); @@ -147,8 +147,6 @@ describe('EtherscanRemoteTransactionSource', () => { fetchEtherscanTokenTransactionsMock.mockResolvedValue( ETHERSCAN_TOKEN_TRANSACTION_RESPONSE_EMPTY_MOCK, ); - - createIdMock.mockReturnValue(ID_MOCK); }); describe('isSupportedNetwork', () => { diff --git a/app/scripts/migrations/098.test.ts b/app/scripts/migrations/098.test.ts index 694bd96af433..80e42a4e2fd8 100644 --- a/app/scripts/migrations/098.test.ts +++ b/app/scripts/migrations/098.test.ts @@ -72,8 +72,8 @@ describe('migration #98', () => { const newStorage = await migrate(oldStorage); - const migratedTransactions = newStorage?.data?.TransactionController - ?.transactions as any; + const migratedTransactions = (newStorage.data.TransactionController as any) + .transactions; Object.keys(migratedTransactions).forEach((newTxId) => { expect(typeof newTxId).toBe('string');