Testing with React Testing Library

ZZeph11/28/2022
Hi! I am trying to test my
DestinationForm
component using react testing library.
My test is simply rendering the component:
test('contains 2 input fields and a submit button', () => {
  const view = render(<DestinationForm />)
})

But I get this error:
TypeError: Cannot destructure property 'client' of 'useContext(...)' as it is null.
const { mutateAsync, error, isLoading } = trpc.itinerary.create.useMutation()

My guess is that I have to somehow wrap the DestinationForm component with some context so that it is aware of the query client but I'm not sure how to.
I'm super new to testing so any help is appreciated(:

Thank you!
UUUnknown User11/30/2022
Message Not Public
Sign In & Join Server To View