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
Dan Harrin
Dan Harrin16mo ago
so you have the same resource registered for 2 panels? or just 1
Conor Hambuch
Conor HambuchOP16mo ago
just one, but not for admin
Dan Harrin
Dan Harrin16mo ago
you can pass in the id of the panel to getUrl ResourceName::getUrl('index', panel: 'panelname')
Conor Hambuch
Conor HambuchOP16mo ago
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.
Dan Harrin
Dan Harrin16mo ago
i dont know whats going on, but something is not set up properly
Want results from more Discord servers?
Add your server