Testing select field options
I've implemented some logic to update the query in a select field using
modifyQueryUsing(closure)
Is there a way to test this logic?
Maybe using a closure with assertFormFieldExists()
?
Like...
I've attempted to get the options using the $input
closure param above with no luck.
Note: My select is multiple()
and has preload()
Any help and/or insight appreciated.7 Replies
Would you like to check the select options?
maybe livewire asserts? https://livewire.laravel.com/docs/testing#assertions
->assertSee
, ->assertSeeHtml
?Laravel
Testing | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
assertSee
and assertSeeHtml
do not work for me in this case because the options are not readily available when the component renders.
I know I can simulate clicks and then test the desired functionality, but looking for alternative takes on properly testing this without going out of the Filament component context, if that makes sense.Hum it is true
@ilker did you ever figure this out? seems like a miss
No, sadly I didn't and moved on without testing that.
That's a bummer. I'm in a similar boat. I'll probably move on for now, but it's a pretty vital part of our site long term. I might need to help provide a patch for that.
Just curious if there has been any updates since last message? Ive had a look through the documentation but couldn't find any updates and testing assertSee / assertSeeHtml still provides no results.