christophrumpel / missing-livewire-assertions

Adding the missing Livewire assertions to your Laravel project
MIT License
136 stars 25 forks source link

Add assertions "assertMethodWiredToEvent" and "assertMethodWiredToEve… #23

Closed dalbo closed 1 year ago

dalbo commented 1 year ago

…ntWithoutModifiers" and their negative versions.

Add tests for these new assertions. Add documentation for these new assertions.

christophrumpel commented 1 year ago

Looks great 🙌 Thanks a lot

christophrumpel commented 1 year ago

Just tried it out in a project, and I see this error. I wonder why the old "assertions" still work and only new ones throw this error 🤔 Any idea?

CleanShot 2023-09-28 at 11 55 24@2x
dalbo commented 1 year ago

I based this on the 1.0 branch, supporting Livewire 2, I didn't look at the Pull Request for Livewire 3. It looks like the method of loading the page content has changed from

$this->stripOutInitialData($this->lastRenderedDom)

to

$this->html()

We've not migrated to Livewire 3 yet though.

christophrumpel commented 1 year ago

Ah, absolutely right. I merged the L3 PR before yours, that was the mistake. Fixed it now for the latest version.

Bug I guess we still need your assertions in the 1.x branch?

dalbo commented 1 year ago

If it's not too painful to merge it in and make a new 1.x release, then that would be fantastic.

christophrumpel commented 1 year ago

Sure, can you trigger a PR from you again to the 1.0 branch?

dalbo commented 1 year ago

I'm pretty new to this, but it looks like there is only a tag for 1.0, no branch. So I'm having trouble triggering a new PR.