<?php

use App\Enums\AnnouncementType;

test('announcement type enum has expected cases', function () {
    expect(AnnouncementType::cases())->toHaveCount(2);
});

test('announcement type enum labels and colors', function (AnnouncementType $type, string $label, string $color) {
    expect($type->getLabel())->toBe($label);
    expect($type->getColor())->toBe($color);
})->with([
    [AnnouncementType::PUBLIC, 'Publik', 'info'],
    [AnnouncementType::COMPANY, 'Perusahaan', 'warning'],
]);

test('announcement type enum options', function () {
    expect(AnnouncementType::options())->toEqual([
        1 => 'Publik',
        2 => 'Perusahaan',
    ]);
});

test('announcement type enum values and comment', function () {
    expect(AnnouncementType::values())->toEqual([1, 2]);
    expect(AnnouncementType::comment())->toBe('1: Publik, 2: Perusahaan');
});
