Open titantwentyone opened 3 years ago
Thanks, I will give that a look. 👍
Hey @titantwentyone, sorry for the late reply. Can you tell if this is still an issue? Just tried it locally with:
App\Http\Livewire\
and child component in App\Http\Livewire\Components
In my tests, both situations are working. Can you maybe check again?
Hi @christophrumpel. My turn to apologise for the delay in responding. I've just upgraded a few apps to Laravel10 and Livewire/Filament v3. This assertion didn't come up much but it's useful when it did. I've provided a repo to demonstrate what I'm seeing here. Tests in AssertionsTest
using Pest.
Think it's a case of ensuring the namespace of the child component is taken into account.
I've added a quick fix for this using assertContainsLivewireComponent2
which you'll see in CustomLivewireAssertionsMixin
. If you're happy, I can PR.
When testing against a component which is in a subdirectory of the main Livewire namespace,
assertContainsLivewireComponent
failstest:
Error comes back:
The following is okay however:
Tried to look at a fix. Since
assertContainsLivewireComponent
usesbasename()
to strip out the class, I used the following (possibly ugly) fix:I wanted to provide a pull request but, while this works me, your tests fail. I guess this is down to the fact that the test components are not in App\Http\Livewire. I'm no Livewire aficionado so I wasn't sure how to resolve this! Happy to help if I can however!