TenantAtlas/tests/Feature/Filament/InventoryPagesTest.php
2026-01-07 17:02:32 +01:00

27 lines
711 B
PHP

<?php
use App\Filament\Pages\InventoryCoverage;
use App\Filament\Pages\InventoryLanding;
use App\Models\Tenant;
use App\Models\User;
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
test('inventory landing and coverage pages load for a tenant', function () {
$tenant = Tenant::factory()->create();
$user = User::factory()->create();
$user->tenants()->syncWithoutDetaching([
$tenant->getKey() => ['role' => 'owner'],
]);
$this->actingAs($user)
->get(InventoryLanding::getUrl(tenant: $tenant))
->assertOk();
$this->actingAs($user)
->get(InventoryCoverage::getUrl(tenant: $tenant))
->assertOk()
->assertSee('Coverage');
});