Closed dwjohnston closed 2 years ago
Hey @dwjohnston, thank you for proposing this. It feels a bit odd to me to change the editor’s API to accommodate any particular testing tool, but I’d definitely want testing with React Testing Library to be possible, so I’ll have a look.
@thibaudcolas I've since removed the onMount stuff - so basically this PR is passing through the aria labels, and adds RTL and a demo test.
@thibaudcolas I'm unable to make sense of the errors in the CI. Are you able to walk this through for me? We are otherwise maintaining a fork just to get those aria properties Note I have removed the pre-publish script, it was erroring locally for me building storybook, you probably want to put that back in.
Thank you @dwjohnston! I’m currently going through a lot of changes to the library, will pick up the remaining test failures later.
This PR allows and demonstrates the use of React Testing Library with Draftail.
It passes through aria properties so RTL style queries can be used.
https://github.com/facebook/draft-js/issues/2833
npm run test:coverage
)npm run lint
)Thanks for contributing to Draftail!