F
Filamentβ€’5mo ago
rutenisraila

Can't pass a tenant parameter to a feature pest test.

Hey, I'm trying to add tests to my app. I'm having trouble passing the tenant id (in my case it's int of 1). Error: Missing required parameter for [Route: filament.company.resources.seo-keywords.index] [URI: company/{tenant}/seo-keywords] I've attached a screenshot of my test. I'm following the docs on how to pass it, but it doesn't seem to work: https://filamentphp.com/docs/3.x/panels/testing#filling-existing-data-1
No description
Solution:
In your beforeEach you probably want to set the tenant: ```php beforeEach(function(){...
Jump to solution
2 Replies
Solution
dissto
disstoβ€’5mo ago
In your beforeEach you probably want to set the tenant:
beforeEach(function(){
// ...
Filament::setTenant(YourTenantModel::class);
});
beforeEach(function(){
// ...
Filament::setTenant(YourTenantModel::class);
});
Also please dont post screenshots of code. Post actual code πŸ˜…
rutenisraila
rutenisrailaOPβ€’5mo ago
Hey, @dissto this has helped, thanks. I've tried setting the tenant in my TestCase but didn't try it in the beforeEach. Thanks!
Want results from more Discord servers?
Add your server