create(); $user = User::factory()->create(); // Own running op BulkOperationRun::factory()->create([ 'tenant_id' => $tenant->id, 'user_id' => $user->id, 'status' => 'running', 'resource' => 'policy', 'action' => 'delete', 'total_items' => 100, 'processed_items' => 50, ]); // Completed op (should not show) BulkOperationRun::factory()->create([ 'tenant_id' => $tenant->id, 'user_id' => $user->id, 'status' => 'completed', ]); // Other user's op (should not show) $otherUser = User::factory()->create(); BulkOperationRun::factory()->create([ 'tenant_id' => $tenant->id, 'user_id' => $otherUser->id, 'status' => 'running', ]); // $tenant->makeCurrent(); $tenant->forceFill(['is_current' => true])->save(); auth()->login($user); // Login user explicitly for auth()->id() call in component Livewire::actingAs($user) ->test(BulkOperationProgress::class) ->assertSee('Delete Policy') ->assertSee('50 / 100'); });