Test relation manager

I'm trying to test the relation managers, like the following:
$thing = Thing::factory()->create();

Livewire::test(OtherThingRelationManager::class, ['ownerRecord' => $thing])
->assertSuccessful();
$thing = Thing::factory()->create();

Livewire::test(OtherThingRelationManager::class, ['ownerRecord' => $thing])
->assertSuccessful();
And I'm getting the following error:
Filament\Resources\RelationManagers\RelationManager::getPageClass(): Return value must be of type string, null returned
Filament\Resources\RelationManagers\RelationManager::getPageClass(): Return value must be of type string, null returned
This happens on
vendor/filament/filament/src/Resources/RelationManagers/RelationManager.php:163
vendor/filament/filament/src/Resources/RelationManagers/RelationManager.php:163
Do you have any ideas? Or more info/examples on how to test Relationship Managers? Thank you!
Solution:
Not sure, have you tried something like this? ```php Livewire::test(OtherThingRelationManager::class, [ 'pageClass' => EditPage::class, 'ownerRecord' => $thing,...
Jump to solution
2 Replies
Solution
Patrick Boivin
Patrick Boivinβ€’10mo ago
Not sure, have you tried something like this?
Livewire::test(OtherThingRelationManager::class, [
'pageClass' => EditPage::class,
'ownerRecord' => $thing,
])
Livewire::test(OtherThingRelationManager::class, [
'pageClass' => EditPage::class,
'ownerRecord' => $thing,
])
paulohenriquesg
paulohenriquesgβ€’10mo ago
Nice! It worked! πŸŽ‰