A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ciphermask/ui/components/app/info-box/info-box.test.js

27 lines
769 B

import React from 'react';
import { fireEvent } from '@testing-library/react';
import { renderWithProvider } from '../../../../test/lib/render-helpers';
import InfoBox from './info-box.component';
describe('InfoBox', () => {
const props = {
title: 'Title',
description: 'Description',
onClose: jest.fn(),
};
it('should match snapshot', () => {
const { container } = renderWithProvider(<InfoBox {...props} />);
expect(container).toMatchSnapshot();
});
it('should call handleClose on info close element', () => {
const { queryByTestId } = renderWithProvider(<InfoBox {...props} />);
const infoBoxClose = queryByTestId('info-box-close');
fireEvent.click(infoBoxClose);
expect(props.onClose).toHaveBeenCalled();
});
});