33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
|
|
use App\Enums\IssueSentiment;
|
|
use Filament\Support\Colors\Color;
|
|
|
|
test('issue sentiment enum has expected cases', function () {
|
|
expect(IssueSentiment::cases())->toHaveCount(4);
|
|
});
|
|
|
|
test('issue sentiment enum labels and colors', function (IssueSentiment $sentiment, string $label, array $color) {
|
|
expect($sentiment->getLabel())->toBe($label);
|
|
expect($sentiment->getColor())->toBe($color);
|
|
})->with([
|
|
[IssueSentiment::POSITIVE, 'Positif', Color::Green],
|
|
[IssueSentiment::NEGATIVE, 'Negatif', Color::Red],
|
|
[IssueSentiment::NEUTRAL, 'Netral', Color::Gray],
|
|
[IssueSentiment::CRISIS, 'Krisis', Color::Orange],
|
|
]);
|
|
|
|
test('issue sentiment enum options', function () {
|
|
expect(IssueSentiment::options())->toEqual([
|
|
1 => 'Positif',
|
|
2 => 'Negatif',
|
|
3 => 'Netral',
|
|
4 => 'Krisis',
|
|
]);
|
|
});
|
|
|
|
test('issue sentiment enum values and comment', function () {
|
|
expect(IssueSentiment::values())->toEqual([1, 2, 3, 4]);
|
|
expect(IssueSentiment::comment())->toBe('1: Positif, 2: Negatif, 3: Netral, 4: Krisis');
|
|
});
|