import React from 'react'; import renderWithTheme from '../../../testUtils/renderWithTheme'; import Icon from '..'; describe('Icon', () => { it('renders custom icon as a react element', () => { const customIcon =

Custom Icon

; const { getByText, container } = renderWithTheme( ); expect(getByText('Custom Icon')).toBeInTheDocument(); expect(container.firstChild).toHaveClass('CustomIconClass'); }); it('renders icon based on icon name', () => { const { container } = renderWithTheme(); expect(container.firstChild).toHaveClass('hero-icon-bell'); }); it('renders spining icon', () => { const { container } = renderWithTheme(); expect(container.firstChild).toHaveStyle( 'animation: bKPVWD 1s infinite linear;' ); }); });