mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-04 23:14:56 +01:00
0bc1eeaf37
* Deprecating Rinkeby, setting default debug network to Goerli * Deprecating Ropsten and Kovan * Conflict fix * Remove unused localization, test fixes * Add migration for moving used deprecated testnets to custom networks * Fix migrator test * Add more unit tests * Migration updates provider type to rpc if deprecated network is selected * Migration fully and correctly updates the provider if selected network is a deprecated testnet * Continue to show deprecation warning on each of rinkeby, ropsten and kovan * Add rpcUrl deprecation message to loading screen * Removing mayBeFauceting prop Co-authored-by: Dan Miller <danjm.com@gmail.com>
65 lines
1.6 KiB
JavaScript
65 lines
1.6 KiB
JavaScript
import React from 'react';
|
|
import configureStore from 'redux-mock-store';
|
|
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
|
|
import { getEnvironmentType } from '../../../../../app/scripts/lib/util';
|
|
import ConfirmPageContainerHeader from '.';
|
|
|
|
jest.mock('../../../../../app/scripts/lib/util.js', () => ({
|
|
...jest.requireActual('../../../../../app/scripts/lib/util.js'),
|
|
getEnvironmentType: jest.fn(),
|
|
}));
|
|
|
|
describe('Confirm Detail Row Component', () => {
|
|
const mockState = {
|
|
appState: {
|
|
isLoading: false,
|
|
},
|
|
metamask: {
|
|
provider: {
|
|
type: 'rpc',
|
|
chainId: '0x5',
|
|
},
|
|
},
|
|
};
|
|
|
|
const store = configureStore()(mockState);
|
|
|
|
it('should match snapshot', () => {
|
|
getEnvironmentType.mockReturnValue('popup');
|
|
|
|
const props = {
|
|
showEdit: false,
|
|
onEdit: jest.fn(),
|
|
showAccountInHeader: false,
|
|
accountAddress: '0xmockAccountAddress',
|
|
};
|
|
|
|
const { container } = renderWithProvider(
|
|
<ConfirmPageContainerHeader {...props} />,
|
|
store,
|
|
);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
|
|
it('should only render children when fullscreen and showEdit is false & snapshot match', () => {
|
|
getEnvironmentType.mockReturnValue('fullscreen');
|
|
|
|
const props = {
|
|
showEdit: false,
|
|
onEdit: jest.fn(),
|
|
showAccountInHeader: false,
|
|
accountAddress: '0xmockAccountAddress',
|
|
};
|
|
|
|
const { container } = renderWithProvider(
|
|
<ConfirmPageContainerHeader {...props}>
|
|
<div className="nested-test-class" />
|
|
</ConfirmPageContainerHeader>,
|
|
store,
|
|
);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
});
|