/* eslint-disable jest/require-top-level-describe */ import { render } from '@testing-library/react'; import React from 'react'; import { COLORS } from '../../../helpers/constants/design-system'; import { Icon, ICON_NAMES } from '../icon'; import { HelpText } from './help-text'; describe('HelpText', () => { it('should render with text inside the HelpText', () => { const { getByText } = render(help text); expect(getByText('help text')).toBeDefined(); }); it('should render with react nodes inside the HelpText', () => { const { getByText, getByTestId } = render( help text , ); expect(getByText('help text')).toBeDefined(); expect(getByTestId('icon')).toBeDefined(); }); it('should render with and additional className', () => { const { getByText } = render( help text, ); expect(getByText('help text')).toBeDefined(); expect(getByText('help text')).toHaveClass('test-class'); }); it('should render with error state', () => { const { getByText } = render( <> error , ); expect(getByText('error')).toHaveClass('text--color-error-default'); }); it('should render with different colors', () => { const { getByText } = render( <> default warning success info , ); expect(getByText('default')).toHaveClass('text--color-text-default'); expect(getByText('warning')).toHaveClass('text--color-warning-default'); expect(getByText('success')).toHaveClass('text--color-success-default'); expect(getByText('info')).toHaveClass('text--color-info-default'); }); });