'Admin']); Role::create(['name' => 'User']); $admin = User::factory()->create([ 'role_id' => $adminRole->id, ]); $this->actingAs($admin); Filament::setCurrentPanel('admin'); $gallery = Gallery::factory()->create([ 'upload_enabled' => true, 'sparkbooth_username' => 'spark-test', 'sparkbooth_password' => 'secret-123', ]); $gallery->setUploadToken('tokentest'); $gallery->save(); Livewire::test(SparkboothConnections::class) ->callTableAction('deleteConnection', $gallery); $updated = $gallery->fresh(); $this->assertDatabaseHas('galleries', ['id' => $gallery->id]); $this->assertNotNull($updated); $this->assertNull($updated->upload_token_hash); $this->assertNull($updated->upload_token_expires_at); $this->assertNull($updated->sparkbooth_username); $this->assertNull($updated->sparkbooth_password); $this->assertFalse($updated->upload_enabled); $this->assertSame(0, Gallery::query()->whereNotNull('upload_token_hash')->count()); } }