<?php

namespace Tests\Unit;

use App\Support\DashboardProjectPathRegistry;
use PHPUnit\Framework\TestCase;

class DashboardProjectPathRegistryTest extends TestCase
{
    public function test_gmail_project_family_includes_history_prefix(): void
    {
        $this->assertContains(
            'user/gmail-sales-history',
            DashboardProjectPathRegistry::pathPrefixesForLink('/gmail-sell')
        );
    }

    public function test_offers_project_matches_orders_history_path(): void
    {
        $this->assertTrue(
            DashboardProjectPathRegistry::pathMatchesLink('orders/history', '/offers')
        );
    }

    public function test_shop_project_matches_related_catalog_and_order_paths(): void
    {
        $this->assertTrue(
            DashboardProjectPathRegistry::pathMatchesLink('product/demo-slug', '/shop')
        );

        $this->assertTrue(
            DashboardProjectPathRegistry::pathMatchesLink('pd-orders/15', '/shop')
        );
    }

    public function test_unrelated_path_does_not_match_project_family(): void
    {
        $this->assertFalse(
            DashboardProjectPathRegistry::pathMatchesLink('withdraw/history', '/gmail-sell')
        );
    }
}
