mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-01 21:57:06 +01:00
a8e194a8f6
* removed recents and added accounts in send flow * updated add contact button and fixed full screen view * updated ui for contacts * fixed lint errors and test * fixed lint errors * fixed lint errors * updated spec files * fixed lint errors * updated snapshot * fixed edit in spec files * removed unused console statement * updated snapshot * added userInput check * updated snapshot and added hover
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();
|
|
});
|
|
});
|
|
});
|