<?php

namespace Tests\Unit\Support;

use App\Support\CatalogMetaLeadEventName;
use Tests\TestCase;

class CatalogMetaLeadEventNameTest extends TestCase
{
    public function test_it_appends_lead_to_an_alphanumeric_brand_slug(): void
    {
        $this->assertSame('ODLead', CatalogMetaLeadEventName::fromBrand('OD'));
    }

    public function test_it_strips_non_alphanumeric_characters_from_the_brand_name(): void
    {
        $this->assertSame('OfficeDepotLead', CatalogMetaLeadEventName::fromBrand('Office Depot'));
    }

    public function test_it_returns_lead_when_the_brand_name_is_empty(): void
    {
        $this->assertSame('Lead', CatalogMetaLeadEventName::fromBrand(null));
        $this->assertSame('Lead', CatalogMetaLeadEventName::fromBrand('   '));
    }
}
