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

Merklin's avatar

Livewire - test user update form

I am trying to make the default livewire test for Profile Update working but with no luck.

in ProfileInformationTest I have

public function test_profile_information_can_be_updated(): void
    {

        $this->actingAs($user = User::factory()->create());

        Livewire::test(UpdateProfileInformationForm::class)
            ->set('state', ['email' => '[email protected]'])
            ->call('updateProfileInformation');

        $this->assertEquals('[email protected]', $user->fresh()->email);
    }

and I got an error Livewire\Exceptions\PropertyNotFoundException: Property [$email] not found on component: [profile.update-profile-information-form]

The field in the form is

<x-label for="email" value="{{ __('Email') }}"/>
            <x-input id="email" type="email" class="mt-1 block w-full" wire:model="state.email" required autocomplete="username"/>
            <x-input-error for="email" class="mt-2"/>

Annu suggestions on what may be wrong?

0 likes
1 reply

Please or to participate in this conversation.