Post

Web component library maintainers, how do you intend for your users to write tests in React with your components? It feels like shadow roots pose a big challenge. I’m wondering if we might need to develop some kind of test harness to abstract the shadow DOM away.

Component consumers should not be testing the internals of your components. That's the component dev's job. You should definitely have APIs available for devs to trigger interactions and validate the APIs are set correctly.

Right, but what should those APIs be? A test harness or methods/properties on the element?

0 reposts0 likes