<?php

declare(strict_types=1);

use App\Models\ProviderConnection;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

it('keeps the explicit minimal provider connection state free of credential side effects', function (): void {
    $connection = ProviderConnection::factory()->minimal()->create();

    expect($connection->credential()->exists())->toBeFalse();
});

it('keeps the explicit standard provider connection state healthy without credential side effects', function (): void {
    $connection = ProviderConnection::factory()->standard()->create();

    expect($connection->is_default)->toBeTrue()
        ->and($connection->credential()->exists())->toBeFalse();
});

it('can opt into a heavier provider graph with a checked-in full factory state', function (): void {
    $connection = ProviderConnection::factory()->full()->create();

    expect($connection->credential()->exists())->toBeTrue()
        ->and($connection->refresh()->is_default)->toBeTrue();
});
