livewire / volt

Volt is an elegantly crafted functional API for Livewire.
https://livewire.laravel.com/docs/volt
MIT License
327 stars 19 forks source link

[Feature] Ability to assert if a page contains a Volt component. #21

Closed thinkverse closed 1 year ago

thinkverse commented 1 year ago

Currently, there is no assertSeeVolt available on the TestResponse or TestView. I've found a way to achieve smoke testing for this using FragmentAlias::encode, it also works with FragmentMap::get. But the latter runs slower and sometimes cannot find a component, guessing it's because it's not in the look-up. 🤔

I submitted a PR earlier to add this to the documentation (https://github.com/livewire/livewire/pull/6204) as an example for others. But given it's a hacky way to achieve the desired result.

Is there a way we could get assertSeeVolt added in a future beta release? 🙂