1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 06:07:06 +01:00
metamask-extension/ui/components/app/modals/eth-sign-modal/eth-sign-modal.test.js
Nidhi Kumari cfc653ada6
eth_sign toggle Update in advanced settings (#18848)
* added eth sign first step

* added modal

* added validation for form

* updated width with block

* added state trigger for toggle

* updated Eth sign modal text changes

* added eth sign toggle tex

* removed unnecessary code

* fixed form validation text

* updated eth toggle text

* added test

* added analytics

* updated design changes

* lint fix

* updated error text

* updated changes
2023-05-04 16:44:07 +05:30

45 lines
1.1 KiB
JavaScript

import React from 'react';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
import EthSignModal from './eth-sign-modal';
const mockHideModal = jest.fn();
const mockGetDisabledRpcMethodPreferences = jest.fn();
jest.mock('../../../../store/actions.ts', () => ({
...jest.requireActual('../../../../store/actions.ts'),
hideModal: () => mockHideModal,
getDisabledRpcMethodPreferences: () => mockGetDisabledRpcMethodPreferences,
}));
describe('Eth Sign Modal', () => {
const mockState = {
appState: {
modal: {
modalState: {
props: {},
},
},
},
metamask: {
provider: {
type: 'rpc',
chainId: '0x5',
},
disabledRpcMethodPreferences: { eth_sign: true },
},
};
const mockStore = configureMockStore([thunk])(mockState);
afterEach(() => {
jest.clearAllMocks();
});
it('should match snapshot', () => {
const { container } = renderWithProvider(<EthSignModal />, mockStore);
expect(container).toMatchSnapshot();
});
});