<?php

use App\Enums\MediaClassification;

describe('MediaClassification Enum', function () {
    it('has media classification cases', function () {
        $cases = MediaClassification::cases();

        expect($cases)->toHaveCount(3)
            ->and(collect($cases)->pluck('value')->toArray())
            ->toEqual([1, 2, 3]);
    });

    it('can get label from case', function () {
        expect(MediaClassification::LOCAL->getLabel())->toBe('Lokal')
            ->and(MediaClassification::REGIONAL->getLabel())->toBe('Regional')
            ->and(MediaClassification::NATIONAL->getLabel())->toBe('Nasional');
    });

    it('can get options array', function () {
        $options = MediaClassification::options();

        expect($options)->toBeArray()
            ->and($options)->toHaveKey(1, 'Lokal')
            ->and($options)->toHaveKey(2, 'Regional')
            ->and($options)->toHaveKey(3, 'Nasional');
    });
});
