TenantAtlas/tests/Feature/Filament/RecentOperationsSummaryWidgetTest.php
2026-03-22 11:24:10 +01:00

30 lines
913 B
PHP

<?php
declare(strict_types=1);
use App\Filament\Widgets\Tenant\RecentOperationsSummary;
use App\Models\OperationRun;
use Livewire\Livewire;
it('renders recent operations from the record tenant in admin panel context', function (): void {
[$user, $tenant] = createUserWithTenant(role: 'owner');
$this->actingAs($user);
OperationRun::factory()->create([
'workspace_id' => (int) $tenant->workspace_id,
'tenant_id' => (int) $tenant->getKey(),
'type' => 'provider.connection.check',
'status' => 'completed',
'outcome' => 'succeeded',
]);
Livewire::actingAs($user)
->test(RecentOperationsSummary::class, ['record' => $tenant])
->assertSee('Recent operations')
->assertSee('Provider connection check')
->assertSee('Run finished')
->assertSee('No action needed.')
->assertDontSee('No operations yet.');
});