<?php

namespace Tests\Unit\Forms;

use App\Domains\Forms\Services\SaleFormService;
use App\Domains\Purchase\Models\Purchase;
use PHPUnit\Framework\TestCase;

class SaleFormServiceTest extends TestCase
{
    public function test_it_returns_every_purchase_status_as_a_form_option(): void
    {
        $form = (new SaleFormService)->get();

        $this->assertSame(Purchase::statuses(), array_column($form['statuses'], 'code'));
        $this->assertSame([
            'Creada',
            'Esperando pago',
            'En revisión',
            'Confirmada',
            'Cancelada',
            'Rechazada',
            'Vencida',
            'Reemplazada',
        ], array_column($form['statuses'], 'name'));
    }
}
