mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-16 06:04:21 +00:00
c0cd668c64
* Layed out components for custom nodes. * Outline of custom nodes. Still missing various features and error handling. * Persist custom nodes to local storage. * Make custom nodes removable. * Add latest block functions, call it when switching nodes. * Initialize correct node, move node utils into utils file. * Fix names * Send headers along with rpc requests. * Remove custom network options for now. * PR feedback. * One last log. * Fix tests. * Headers in batch too. * Switch to node when you add it. * Reduce hackery. * Clean up linter and tsc. * Fix latest block hex conversion. * Unit tests. * Fix missing property. * Fix Modal title typing.
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import Enzyme from 'enzyme';
|
|
import Adapter from 'enzyme-adapter-react-16';
|
|
import SendTransaction from 'containers/Tabs/SendTransaction';
|
|
import shallowWithStore from '../utils/shallowWithStore';
|
|
import { createMockStore } from 'redux-test-utils';
|
|
import { NODES } from 'config/data';
|
|
|
|
Enzyme.configure({ adapter: new Adapter() });
|
|
|
|
it('render snapshot', () => {
|
|
const testNode = 'rop_mew';
|
|
const testStateConfig = {
|
|
languageSelection: 'en',
|
|
nodeSelection: testNode,
|
|
node: NODES[testNode],
|
|
gasPriceGwei: 21,
|
|
offline: false,
|
|
forceOffline: false
|
|
};
|
|
const testState = {
|
|
wallet: {},
|
|
balance: {},
|
|
tokenBalances: {},
|
|
node: {},
|
|
nodeLib: {},
|
|
network: {},
|
|
tokens: [],
|
|
gasPrice: {},
|
|
transactions: {},
|
|
offline: {},
|
|
forceOffline: {},
|
|
config: testStateConfig,
|
|
customTokens: []
|
|
};
|
|
const location = {
|
|
search:
|
|
'?to=73640ebefe93e4d0d6e9030ee9c1866ad1f3b9f1feeb403e978c4952d8369b39'
|
|
};
|
|
const store = createMockStore(testState);
|
|
const component = shallowWithStore(
|
|
<SendTransaction location={location} />,
|
|
store
|
|
);
|
|
|
|
expect(component).toMatchSnapshot();
|
|
});
|