import { create } from 'react-test-renderer'; import ButtonLink from './ButtonLink'; describe('ButtonLink', () => { test('renders', () => { const component = create( , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); test('renders with icon on the right', () => { const component = create( , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); it('renders with icon on the left', () => { const instance = create( , ).root; expect(instance.find((element: any) => element.type === 'svg')).not.toBeNull(); }); test('renders disabled', () => { const component = create( , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); });