import React, { ReactNode } from 'react';
import { render } from '@testing-library/react';
import { PolymorphicAs } from '@leafygreen-ui/polymorphic';
import Description from './Description';
const renderDescription = ({
as,
children = 'Test description',
}: {
as?: PolymorphicAs;
children?: ReactNode;
}) => {
return render(
element when children is a string', () => { const { container } = renderDescription({ children: 'Test description' }); expect(container.querySelector('p')).toBeInTheDocument(); }); test('renders as a
element when children is a number', () => { const { container } = renderDescription({ children: 123 }); expect(container.querySelector('p')).toBeInTheDocument(); }); test('renders as a