<?php

use App\Enums\ContentType;

describe('ContentType Enum', function () {
    it('has content type cases', function () {
        $cases = ContentType::cases();

        expect($cases)->not()->toBeEmpty()
            ->and(collect($cases)->pluck('value')->toArray())->toBeArray();
    });

    it('can get label from case', function () {
        expect(ContentType::FOTO->getLabel())->toBe('Foto')
            ->and(ContentType::TEXT->getLabel())->toBe('Teks')
            ->and(ContentType::GRAPHIC->getLabel())->toBe('Grafis')
            ->and(ContentType::VIDEO->getLabel())->toBe('Video');
    });

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

        expect($options)->toBeArray()
            ->and($options)->toHaveKey('Foto', 'Foto')
            ->and($options)->toHaveKey('Teks', 'Teks');
    });
});
