Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
OGPoyraz committed Sep 18, 2023
1 parent b007b23 commit e060a75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
TransactionStatus,
TransactionType,
} from '../../../../shared/constants/transaction';
import createRandomId from '../../../../shared/modules/random-id';
import type {
EtherscanTokenTransactionMeta,
EtherscanTransactionMeta,
Expand All @@ -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',
Expand Down Expand Up @@ -135,8 +137,6 @@ describe('EtherscanRemoteTransactionSource', () => {
typeof fetchEtherscanTokenTransactions
>;

const createIdMock = createRandomId as jest.MockedFn<typeof createRandomId>;

beforeEach(() => {
jest.resetAllMocks();

Expand All @@ -147,8 +147,6 @@ describe('EtherscanRemoteTransactionSource', () => {
fetchEtherscanTokenTransactionsMock.mockResolvedValue(
ETHERSCAN_TOKEN_TRANSACTION_RESPONSE_EMPTY_MOCK,
);

createIdMock.mockReturnValue(ID_MOCK);
});

describe('isSupportedNetwork', () => {
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/migrations/098.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit e060a75

Please sign in to comment.