livewire()->fillForm() not working

I have several tests using the same helper. All tests are working except for one, and I can't figure out why. I'm going to leave the simplest example possible just to show the problem:

VehicleTest:
it('works', function () {
    livewire(CreateVehicle::class)
        ->fillForm([
            'plate' => 'someplate',
        ])
        ->assertFormSet([
            'plate' => 'someplate',
        ]);
});


VehicleResource:
public static function form(Form $form): Form
{
    return $form
        ->schema([
            TextInput::make('plate'),
        ]);
}


CreateVehicle:
class CreateVehicle extends CreateRecord
{
    protected static string $resource = VehicleResource::class;
}


That exact test is not working, giving:
Failed asserting that null matches expected 'someplate'
Even though it works if I manually create that vehicle in the actual page.
Solution
change to testing
Was this page helpful?