<?php

namespace Tests\Feature\Marketing;

use App\Models\Package;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Inertia\Testing\AssertableInertia as Assert;
use Tests\TestCase;

class PackagesPageTest extends TestCase
{
    use RefreshDatabase;

    public function test_packages_page_renders_available_packages(): void
    {
        Package::factory()->count(2)->endcustomer()->create();
        Package::factory()->count(1)->reseller()->create();

        $response = $this->get('/de/packages');

        $response->assertOk();
        $response->assertInertia(fn (Assert $page) => $page
            ->component('marketing/Packages')
            ->has('endcustomerPackages', 2)
            ->has('resellerPackages', 1)
        );
    }
}
