trying to test filament routes with pest
Im trying to implement this Pestphp smoke testing https://x.com/enunomaduro/status/1621203345036742656
but idk why it just dont work with filament routes
i get all routes from
php artisan route:list
but not even the single ->with(['/panel/login'])
work, what am i doing wrong?Solution:Jump to solution
@Dennis Koch I tried following that tweet code example and used a route string like
panel/login
, but I figured it's better to use something like PostResource::getUrl('index')
instead4 Replies
We need a bit more information than "doesn't work". You should share some code.
Do you have a logged in user when doing these tests?
Solution
@Dennis Koch I tried following that tweet code example and used a route string like
panel/login
, but I figured it's better to use something like PostResource::getUrl('index')
insteadThat would have been the next thing 😅
Btw. you can use
Filament::getPages()
and Filament::getResources()
to get all pages and resources to make your test easieroh nice tip, thank you ❤️