Can't access tenant in Test class?
A simple test like this:
fails because it says it's missing the tenant parameter in the route. I've tried doing something like
Filament::setTenant(Team::factory()->create());
in my setup method, and various other things and can't seem to get it to either use a fake tenant, or to ignore the tenant entirely. This particular page doesn't even rely on tenancy, it just exists in a panel where tenancy is used.
Any ideas?2 Replies
You need to pass the tenant id to the class. So something like
Probably need to pass the record too. Look at the testing docs for panels. That concept is the same.
Just because you set the tenant doesn’t mean it’s automatically inferred in a testing context unless you are hitting an actual route so livewire needs it passed it directly.
ok, i'll give it a try, thanks!