Define tenant in PestPHP test

I'm writing a test to check if it can render my list page, i'm using this code:
it('can render the index page', function () {
livewire(ListAccounts::class, [
'tenant' => $this->household,
])
->assertSuccessful();
})->group('index', 'page', 'resource');
it('can render the index page', function () {
livewire(ListAccounts::class, [
'tenant' => $this->household,
])
->assertSuccessful();
})->group('index', 'page', 'resource');
But i'm getting this error:
Illuminate\Routing\Exceptions\UrlGenerationException: Missing required parameter for [Route: filament.household.resources.accounts.index] [URI: {tenant}/accounts] [Missing parameter: tenant].
Illuminate\Routing\Exceptions\UrlGenerationException: Missing required parameter for [Route: filament.household.resources.accounts.index] [URI: {tenant}/accounts] [Missing parameter: tenant].
does anyone know the right way of providing the tenant?
1 Reply
Dennis Koch
Dennis Koch7mo ago
I think you just call Filament::setTenant() and set your tenant? Check this thread: https://discord.com/channels/883083792112300104/1215538795991007293/1223672024422154260
Want results from more Discord servers?
Add your server