import { create } from 'react-test-renderer'; import Avatar from './Avatar'; describe('Avatar', () => { it('renders multi-byte character initial', () => { const component = create(, { createNodeMock() { return { clientWidth: 100 }; }, }); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); it('renders with an empty name shows default icon', () => { const tree = create().toJSON(); expect(tree).toMatchSnapshot(); }); it('renders an outline', () => { const tree = create().toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the verified icon', () => { const tree = create().toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the correct src', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the correct size - xs', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the correct size - sm', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the correct size - md', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the correct size - lg', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the correct size - xl', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders the checkmark on verified default', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); });