import React from 'react' ; import { render } from '@testing-library/react' ; import MainHeading from './main-heading' ; describe ( 'Index Page' , ( ) => { it ( 'renders correctly' , ( ) => { const { asFragment } = render ( < MainHeading />); expect ( asFragment ( ) ) . toMatchSnapshot ( ) ; } ) ; it ( 'renders hello world' , ( ) => { const { getByTestId } = render ( < MainHeading > Hello World < /MainHeading>); const ACTUAL = getByTestId ( 'main-heading' ) . textContent ; expect ( ACTUAL ) . toEqual ( 'Hello World' ) ; } ) ; } ) ;