F
Filamentβ€’5mo ago
Mavv

ComponentNotFoundException: Unable to find component (PHPUnit)

I wanted to start writing tests for filling out my forms using PHPUnit (no Pest). But I keep running into the same issue. See here my testing code:
use App\Filament\Resources\MusicianResource;
use Livewire\Livewire;

public function testFillForm()
{
Livewire::test(MusicianResource::class)
->fill([...]);
}
use App\Filament\Resources\MusicianResource;
use Livewire\Livewire;

public function testFillForm()
{
Livewire::test(MusicianResource::class)
->fill([...]);
}
I always get this error message: Livewire\Exceptions\ComponentNotFoundException: Unable to find component: [App\Filament\Resources\MusicianResource] I tried looking up the filament testing page and the Livewire testing page.
Solution:
Thanks. The issue then is, that I was trying to test the whole resource, but one must always test the individual pages πŸ‘
Jump to solution
2 Replies
LeandroFerreira
LeandroFerreiraβ€’5mo ago
Pages are livewire components, as ListPage, CreatePage, etc..
Solution
Mavv
Mavvβ€’5mo ago
Thanks. The issue then is, that I was trying to test the whole resource, but one must always test the individual pages πŸ‘
Want results from more Discord servers?
Add your server