<?php

namespace Tests\Feature;

use App\Models\Customer;
use App\Models\JobCard;
use App\Models\User;
use App\Models\Vehicle;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\View;
use Tests\TestCase;

class CustomerPortalViewTest extends TestCase
{
    use RefreshDatabase;

    public function test_customer_portal_component_renders_minimally(): void
    {
        // Minimal plain objects to satisfy template expectations
        $customer = (object) ['name' => 'Test Customer', 'email' => 'test@example.com'];
        $vehicle = (object) [
            'year' => '2023',
            'make' => 'Toyota',
            'model' => 'Corolla',
            'license_plate' => 'ABC-123',
            'vin' => 'VIN123',
            'mileage' => 10000,
        ];
        $jobCard = (object) [
            'id' => 123,
            'status' => 'pending',
            'customer' => $customer,
            'vehicle' => $vehicle,
            'estimates' => \Illuminate\Support\Collection::make([]),
            'serviceAdvisor' => null,
            'description' => null,
        ];

    $html = View::make('livewire.customer-portal.job-status', compact('jobCard'))->render();

        $this->assertStringContainsString('Customer Portal', $html);
        $this->assertStringContainsString((string) $jobCard->id, $html);
    }
}
