Testing view page in nested resource

Did someone already testing the nested resource? So I have this structure, Parent -> Child, i want to testing the view page
Livewire::test(ViewSomePage::class, [
'parentRecord' => $parentRecord,
'record' => $child->getRouteKey(),
])
->assertSee([
'something',
])
Livewire::test(ViewSomePage::class, [
'parentRecord' => $parentRecord,
'record' => $child->getRouteKey(),
])
->assertSee([
'something',
])
I got this error when i run the test
Missing required parameter for [Route: filament.admin.resources.forms.view] [URI: admin/{tenant}/forms/{record}] [Missing parameter: record].
Missing required parameter for [Route: filament.admin.resources.forms.view] [URI: admin/{tenant}/forms/{record}] [Missing parameter: record].
When I diving into the code, i found that this because the breadcrumb stuff, so if i turn the breadcrumb off, the test passed, do someone know how to solve this? without turn off the breadcrumb? like maybe how to set it in the test? Thanks
No description
4 Replies
Čamap
Čamap2mo ago
Did you manage to fix this?
Jonathan Christiani
Not yet mate
CT
CT2mo ago
fyi there's an open issue here you might want to follow; https://github.com/filamentphp/filament/issues/17476
GitHub
Testing Nested Resources · Issue #17476 · filamentphp/filament
Package filament/filament Package Version v4 Laravel Version v12 Livewire Version No response PHP Version 8.4 Problem description I am trying to test nested resources in the same way that I would e...
Jonathan Christiani
Thanks mate @ctoma

Did you find this page helpful?