<?php

use App\Enums\FuelType;

it('resolves diesel alias to B7Standard', function () {
    expect(FuelType::fromAlias('diesel'))->toBe(FuelType::B7Standard);
});

it('resolves petrol alias to E10', function () {
    expect(FuelType::fromAlias('petrol'))->toBe(FuelType::E10);
});

it('resolves unleaded alias to E10', function () {
    expect(FuelType::fromAlias('unleaded'))->toBe(FuelType::E10);
});

it('resolves premium_unleaded alias to E5', function () {
    expect(FuelType::fromAlias('premium_unleaded'))->toBe(FuelType::E5);
});

it('accepts canonical enum values as aliases', function () {
    expect(FuelType::fromAlias('e10'))->toBe(FuelType::E10);
    expect(FuelType::fromAlias('b7_standard'))->toBe(FuelType::B7Standard);
});

it('throws ValueError for unknown alias', function () {
    FuelType::fromAlias('avgas');
})->throws(ValueError::class);
