Help with table action test
FAILED Tests\Feature\Software\Resources\UserResource\ListUsersTest > table actions TypeError
Filament\Resources\Pages\ListRecords::Filament\Resources\Pages{closure}(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, null given, called in D:\Work\laragon\www\myapp\vendor\filament\support\src\Concerns\EvaluatesClosures.php on line 35
the test fails here i'm not sure why can someone maybe help me
9 Replies
any one can help?
Does it pass before
$user2 = User::factory()->create();
?@Leandro Ferreira yes
@Leandro Ferreira
for now im using this so it can just pass
ok but you want to test it creating a user1, deleting it and creating a user2, right?
no just that it appears with corect url its a EditAction \ ViewAction
i think this is fine enough do you agree?
I think you could use
thanks il give it a shot
tip: https://pestphp.com/docs/plugins#content-livewire
livewire(ListUsers::class)
instead of Livewire::test(ListUsers::class)
Plugins | Pest - The elegant PHP Testing Framework
In this section, we will discuss the official and community developed plugins that we endorse. Plugins primarily offer namespaced functions, console commands, custom expectations, and additional command-line options to augment the default Pest experience.
@Leandro Ferreira thank you