Looking for ways to test live components in a way that is independent from the live views in my app. I see that phoenix playground allows single module liveview apps. Can I render live components inside a playground liveview for testing? Are there any downsides to doing this?
I saw your other post about testing LiveComponents too. I saw this blogpost passing by a few ago, which might interest you (I’m not the author): https://arbeo.dev/testing-your-first-component-in-isolation-with-live-isolated-component/
You can, at least as long as your components are fully functional, meaning no side-effects. Since all live_components can execute code, it’s fully up to you to respect conventions and use message passing for events that are happening in the component.
While making functional components is great, sometimes this not entirely possible, not without introducing complexity at least, so it’s up to you to decide on how you approach this based on your needs.