import { BadgeProps } from '../badge'; import { Sentiment, Size, ProfileType } from '../common'; import { render, screen, mockMatchMedia } from '../test-utils'; import AvatarWrapper from '.'; mockMatchMedia(); const name = 'Elizabeth Alexandra Mary Windsor'; describe('FlowNavigationAvatar', () => { describe('with a name', () => { it('shows the initials for a long name', () => { render(); expect(screen.getByText('EW')).toBeInTheDocument(); }); it('shows the first letter for a mononym', () => { render(); expect(screen.getByText('Z')).toBeInTheDocument(); }); describe('AND profileType', () => { describe('FlowNavigationAvatar', () => { describe('with a name', () => { it('shows the initials for a long name', () => { render(); expect(screen.getByText('EW')).toBeInTheDocument(); }); it('shows the first letter for a mononym', () => { render(); expect(screen.getByText('M')).toBeInTheDocument(); }); }); }); describe('with nothing passed', () => { it('renders aria-label', () => { render(); expect(screen.getByLabelText('test')).toBeInTheDocument(); }); }); describe('with a badge status icon passed', () => { it('renders the badge', () => { render(); expect(screen.getByTestId('check-icon')).toBeInTheDocument(); }); it('renders aria-label', () => { render(); expect(screen.getByLabelText('test')).toBeInTheDocument(); }); }); }); }); });