Fix coupon enum formatting in Filament table
This commit is contained in:
19
tests/Unit/CouponsTableTest.php
Normal file
19
tests/Unit/CouponsTableTest.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Enums\CouponStatus;
|
||||
use App\Enums\CouponType;
|
||||
use App\Filament\Resources\Coupons\Tables\CouponsTable;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CouponsTableTest extends TestCase
|
||||
{
|
||||
public function test_it_formats_enum_states(): void
|
||||
{
|
||||
$this->assertSame(CouponType::FLAT->label(), CouponsTable::formatEnumState(CouponType::FLAT));
|
||||
$this->assertSame(CouponStatus::PAUSED->label(), CouponsTable::formatEnumState(CouponStatus::PAUSED));
|
||||
$this->assertSame('Flat Per Seat', CouponsTable::formatEnumState('flat_per_seat'));
|
||||
$this->assertSame('', CouponsTable::formatEnumState(null));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user