Choose Panel when testing
I'm wondering how can I choose panel when I'm testing, because the example given in the documentation works only on the admin panel. getUrl function gives APP_URL/admin.
Livewire::test(ResourceName::getUrl('index'))
->assertFormExists();.
This gives /admin/panelname/resource-name, but the page is at /panelname/resource-name.
If I make it like this: AvailableParcelsResource::getUrl('index', [], true, 'panelname'), it cannot find Route [filament.panelname.resources.resource-name.index].
5 Replies
so you have the same resource registered for 2 panels?
or just 1
just one, but not for admin
you can pass in the id of the panel to getUrl
ResourceName::getUrl('index', panel: 'panelname')
That is the same like I tried and the same error comes: Route [filament.panelname.resources.resource-name.index] not defined.
BTW this is a resource made with 'old' filament (v2), and I use ->discoverResources to register it in the panel provider and works well if I use the UI, but not in the test.
i dont know whats going on, but something is not set up properly