2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
2023-01-17 16:51:35 +01:00
|
|
|
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 '.';
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
describe('Add Recipient Component', () => {
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('render', () => {
|
2023-01-17 16:51:35 +01:00
|
|
|
const mockStore = configureMockStore()(mockState);
|
|
|
|
it('should match snapshot', () => {
|
|
|
|
const { container } = renderWithProvider(<AddRecipient />, mockStore);
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2023-01-17 16:51:35 +01:00
|
|
|
});
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
describe('Send State', () => {
|
|
|
|
const mockStore = configureMockStore()(mockSendState);
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
it('should match snapshot', () => {
|
|
|
|
const { container } = renderWithProvider(<AddRecipient />, mockStore);
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2023-01-17 16:51:35 +01:00
|
|
|
});
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
describe('Domain Resolution', () => {
|
|
|
|
const mockDomainResolutionState = {
|
|
|
|
...mockState,
|
|
|
|
DNS: {
|
|
|
|
resolution: 'DNS Resolution',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
const mockStore = configureMockStore()(mockDomainResolutionState);
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
it('should match snapshot', () => {
|
|
|
|
const { container } = renderWithProvider(<AddRecipient />, mockStore);
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2023-01-17 16:51:35 +01:00
|
|
|
});
|
2019-07-31 21:56:44 +02:00
|
|
|
|
2023-01-17 16:51:35 +01:00
|
|
|
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();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|