The reports of my death were greatly exaggerated
TL;DR What is the recommended React Testing Library way to test this?
I successfully upgraded Tailwind (to v3) and React (to v18), but there's a problem: contrary to this library, Enzyme is dead and a move to React Testing Library is unavoidable. That's not a bad thing, RTL is better, but this project was setup using a different philosophy.
Testing like this is discouraged using RTL:
it('should render with large styles', () => {
const expected = 'w-10 h-10'
const wrapper = mount(<Avatar src="test" size="large" />)
expect(wrapper.find(Avatar).getDOMNode().getAttribute('class')).toContain(expected)
})
A WIP branch is available here if you want to try something, as I had to create my own version of jest-svg-transformer: master...wip-upgrade
There, you'll find that Avatar was already converted to RTL, while Alert is broken and Backdrop is still WIP.
The reports of my death were greatly exaggerated
TL;DR What is the recommended React Testing Library way to test this?
I successfully upgraded Tailwind (to v3) and React (to v18), but there's a problem: contrary to this library, Enzyme is dead and a move to React Testing Library is unavoidable. That's not a bad thing, RTL is better, but this project was setup using a different philosophy.
Testing like this is discouraged using RTL:
A WIP branch is available here if you want to try something, as I had to create my own version of
jest-svg-transformer: master...wip-upgradeThere, you'll find that
Avatarwas already converted to RTL, whileAlertis broken andBackdropis still WIP.