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.
26 lines
769 B
26 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();
|
|
});
|
|
});
|
|
|