- Implemented the customer portal workflow progress component with detailed service progress tracking, including current status, workflow steps, and contact information. - Developed a management workflow analytics dashboard featuring key performance indicators, charts for revenue by branch, labor utilization, and recent quality issues. - Created tests for admin-only middleware to ensure proper access control for admin routes. - Added tests for customer portal view rendering and workflow integration, ensuring the workflow service operates correctly through various stages. - Introduced a .gitignore file for the debugbar storage directory to prevent unnecessary files from being tracked.
45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?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);
|
|
}
|
|
}
|