import React from 'react' ; import { render , screen } from '@testing-library/react' ; import { TrainerComponent } from './trainer.component' ; describe ( 'TrainerComponent tests' , ( ) => { it ( 'should render all the expected sub components' , ( ) => { const props = { handleAppendTrainerText : ( trainerText ) => { } , handleSendFullContentLog : ( fullContent ) => { } , currentTrainerUrl : 'http://current.trainer.url' , currentStudentUrl : 'http://current.student.url' , log : 'This is the log' , } ; render ( < TrainerComponent { ... props } / > ) ; const trainerLink = screen . getByRole ( 'textbox' , { name : 'Trainer Link' } ) ; const sendButton = screen . getByRole ( 'button' , { name : 'Send' } ) ; const sendFullContentButton = screen . getByRole ( 'button' , { name : 'Send Full Content' } ) ; expect ( trainerLink ) . toBeInTheDocument ( ) ; expect ( sendButton ) . toBeInTheDocument ( ) ; expect ( sendFullContentButton ) . toBeInTheDocument ( ) ; } ) ; } ) ;