Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Tiskiel's avatar

How test list with them widgets ?

Hi everyone,

I have a case where I throw an error DivisionByZero cause I forgot a guard but because of this I d'like to test this.

But if I use this :

it('can render the page with empty list', function () {
    Conversion::query()->delete();

    $this->actingAs(User::factory()->create(['is_active' => 1]));
    $this->get(ConversionResource::getUrl())->assertStatus(500);
})->only();

or

This one :

it('can render the page with empty list', function () {
    Conversion::query()->delete();

    $this->actingAs(User::factory()->create(['is_active' => 1]));
    livewire(ListConversions::class)
        ->assertStatus(500);
})->only();

Both failed and assert status 200

Do you have any ideas ?

Thank you in advance

0 likes
0 replies

Please or to participate in this conversation.