hotwired-laravel / turbo-laravel

This package gives you a set of conventions to make the most out of Hotwire in Laravel.
https://turbo-laravel.com
MIT License
803 stars 50 forks source link

Testing helpers #3

Closed tonysm closed 3 years ago

tonysm commented 3 years ago

I think there is room for testing helpers in the package. Something like:

$this->turbo()->post()

// or

$this->turboPost()

I think I prefer the first one, because the second one would require adding more test methods, while the first one would simply add the specific header.

Also, some assertion helpers, something like:

$response->assertTurboStream()

Not sure if we can add helpers to check the streams, like if there was an append to a specific target or something like that.

tonysm commented 3 years ago

Created a testing helper package: https://github.com/tonysm/turbo-laravel-test-helpers