Table deferLoading() and Tests

When using
$table->deferLoading();
$table->deferLoading();
on a table, how refactor our pest tests that check table records? If do something like
livewire(MultiUnitUpdates::class, ['propertyManager' => $property_manager])
->assertCanSeeTableRecords([$floorplan->id])
livewire(MultiUnitUpdates::class, ['propertyManager' => $property_manager])
->assertCanSeeTableRecords([$floorplan->id])
It appears that it doesnt really wait until the table loads to verify. This test passes just fine when the table does not have deferLoading() defined.
Solution:
Oop, just found loadTable() should be used according to the docs.
Jump to solution
2 Replies
Solution
Mark Chaney
Mark Chaney8h ago
Oop, just found loadTable() should be used according to the docs.
awcodes
awcodes8h ago
Or ->withoutLazyLoading() on the component maybe.🤔

Did you find this page helpful?