<?php

use App\Enums\IsActive;

test('is active enum has expected cases', function () {
    expect(IsActive::cases())->toHaveCount(2);

    expect(IsActive::ACTIVE->value)->toBe(1);
    expect(IsActive::INACTIVE->value)->toBe(2);
});

test('is active enum has correct labels', function () {
    expect(IsActive::ACTIVE->getLabel())->toBe('Aktif');
    expect(IsActive::INACTIVE->getLabel())->toBe('Tidak Aktif');
});

test('is active enum has correct colors', function () {
    expect(IsActive::ACTIVE->getColor())->toBe('success');
    expect(IsActive::INACTIVE->getColor())->toBe('danger');
});

test('is active enum options method returns correct array', function () {
    $options = IsActive::options();

    expect($options)->toBeArray()
        ->toHaveCount(2)
        ->toEqual([
            1 => 'Aktif',
            2 => 'Tidak Aktif',
        ]);
});

test('is active enum values method returns correct array', function () {
    expect(IsActive::values())->toEqual([1, 2]);
});

test('is active enum comment method returns correct string', function () {
    expect(IsActive::comment())->toBe('1: Aktif, 2: Tidak Aktif');
});
