You can use toHaveClass from jest DOM
it('renders textinput with optional classes', () => { const { container } = render(<TextArea {...props} className='class1' />) expect(container.children[1]).toHaveClass('class1') }) Don't forgot to destructure response like this {container}{container} Because By default, React Testing Library will create a div and append that div to the document.bodydocument.body and this is where your React component will be rendered. If you provide your own HTMLElementHTMLElement container via this option, it will not be appended to the document.bodydocument.body automatically.