import * as React from 'react'; import {ProfileButton} from '../index'; import {render} from '../../test-utils'; describe('ProfileButton', () => { it('should render', () => { const wrapper = render(); expect(wrapper.queryByText('initials')).toBeInTheDocument(); }); it('should render image if portraitSrc is provided', () => { const wrapper = render(); expect(wrapper.container.querySelector(`img`)).toBeInTheDocument(); expect(wrapper.queryByText('initials')).not.toBeInTheDocument(); }); it('should render initials if portraitSrc is not provided and initials are', () => { const wrapper = render(); expect(wrapper.container.querySelector(`img`)).not.toBeInTheDocument(); expect(wrapper.queryByText('initials')).toBeInTheDocument(); }); });