import React from 'react' ; import { render , cleanup , findByTestId } from '@testing-library/react' ; import { componentAtomTree } from '../../../../types' ; import { shallow } from 'enzyme' ; import Metrics from '../Metrics' ; describe ( 'Metrics graph testing' , ( ) => { afterEach ( cleanup ) ; const wrapper = shallow ( < Metrics includedProp = { cleanedComponentAtomTree } / > ) ; describe ( 'shape of props being passed down should match cleanedComponentAtomTree shape' , ( ) => { expect ( wrapper . props ( ) . includedProp ) . toMatchObject ( componentAtomTree ) ; } ) ; describe ( 'component is being rendered correctly' , ( ) => { const { getByTestId } = render ( < Metrics />); expect ( getByTestId ( 'canvas' ) ) . toBeTruthy ( ) ; } ) ; } ) ;