1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00
metamask-extension/ui/pages/send/send-content/add-recipient/add-recipient.component.test.js
Thomas Huang 4c3c4eebac
Final conversion of tests from enzyme to @testing-library/react (#16862)
* 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>
2023-01-17 07:51:35 -08:00

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();
});
});
});