Testing live() and afterStateUpdated()

for a pest test and testing live(), should assertSet() be used? This is what i am trying, but getting null for the year_built value according to the assertSet output. If i try assertFormSet() of course i just get the original fill values.
test('selecting a property field updates year built and total units field', function () {

    ray($this->rfta->property->year_built)->label('rfta property - year_built');
    $property = Property::factory()->create();
    ray($property->year_built)->label('new property - year_built');

    // Simulate selecting a property to see if other fields are updated
    /** @phpstan-ignore-next-line */
    livewire(RftaResource\Pages\EditRfta::class, ['record' => $this->rfta->id])
        ->set('property_id', $property->id)
        ->assertSet('year_built', $property->year_built)
        ->assertSet('total_units', $property->total_units);
});
Was this page helpful?