<?php

declare(strict_types=1);

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

uses(RefreshDatabase::class);

it('can create tenants without provisioning a workspace graph when the minimal state is explicit', function (): void {
    $tenant = ManagedEnvironment::factory()->minimal()->create();

    expect($tenant->workspace_id)->toBeNull();
});

it('keeps the default tenant factory path workspace-ready for existing callers', function (): void {
    $tenant = ManagedEnvironment::factory()->create();

    expect($tenant->workspace_id)->not->toBeNull();
});

it('restores default workspace provisioning after an explicit minimal tenant is created', function (): void {
    ManagedEnvironment::factory()->minimal()->create();

    $tenant = ManagedEnvironment::factory()->create();

    expect($tenant->workspace_id)->not->toBeNull();
});