mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 23:58:06 +01:00
4c3c4eebac
* Add transaction activity log component * Remove duplicate tx activity log snapshot. * Convert Advanced Tab to tlr. * Lint fix * Change ENS to DNS in mock state data. * Add test ids for speedup, cancel, rety buttons. * Convert TransactionListItemDetails component to RTL. * Convert PageContainerHeader component to RTL. * Convert TokenInput component to RTL. * Convert UnitInput component to RTL. * Convert withModalProps to RTL. * Convert i18n-helper to RTL. * Convert ConfirmSeedPhrase component to TLR. * Convert AddRecipient component to RTL. * Set process.env metamask build type to 'main' for test Co-authored-by: Brad Decker <bhdecker84@gmail.com> Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
import React from 'react';
|
|
import configureMockStore from 'redux-mock-store';
|
|
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
|
|
import mockState from '../../../../../test/data/mock-state.json';
|
|
import mockSendState from '../../../../../test/data/mock-send-state.json';
|
|
import AddRecipient from '.';
|
|
|
|
describe('Add Recipient Component', () => {
|
|
describe('render', () => {
|
|
const mockStore = configureMockStore()(mockState);
|
|
it('should match snapshot', () => {
|
|
const { container } = renderWithProvider(<AddRecipient />, mockStore);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
});
|
|
|
|
describe('Send State', () => {
|
|
const mockStore = configureMockStore()(mockSendState);
|
|
|
|
it('should match snapshot', () => {
|
|
const { container } = renderWithProvider(<AddRecipient />, mockStore);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
});
|
|
|
|
describe('Domain Resolution', () => {
|
|
const mockDomainResolutionState = {
|
|
...mockState,
|
|
DNS: {
|
|
resolution: 'DNS Resolution',
|
|
},
|
|
};
|
|
const mockStore = configureMockStore()(mockDomainResolutionState);
|
|
|
|
it('should match snapshot', () => {
|
|
const { container } = renderWithProvider(<AddRecipient />, mockStore);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
});
|
|
|
|
describe('Own Account Recipient Search', () => {
|
|
const ownAccountSeachState = {
|
|
...mockState,
|
|
send: {
|
|
...mockState.send,
|
|
recipientInput: 'Test',
|
|
recipientMode: 'MY_ACCOUNTS',
|
|
},
|
|
};
|
|
const mockStore = configureMockStore()(ownAccountSeachState);
|
|
|
|
it('should match snapshot', () => {
|
|
const { container } = renderWithProvider(<AddRecipient />, mockStore);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
});
|
|
});
|