Files
WMS/Modules/Helpdesk/Tests/Feature/TicketIndexDirectUserNPlusOneFilesTest.php
T
Mark Gregory 86f0082a84 It fixes the remaining stale test and keeps the actual N+1 strategy:
* Main ticket index renders scalar agent_name.
* Ticket index still eager-loads user, owner, agent.
* Ticket show comments no longer eager-load fake owner / agent relations.
* Updated the conflicting regression tests.
2026-06-26 12:07:09 +01:00

20 lines
709 B
PHP

<?php
declare(strict_types=1);
namespace Modules\Helpdesk\Tests\Feature;
use Tests\TestCase;
final class TicketIndexDirectUserNPlusOneFilesTest extends TestCase
{
public function test_ticket_index_eager_loads_direct_user_relation(): void
{
$source = file_get_contents(dirname(__DIR__, 2) . '/Livewire/TicketIndex.php');
self::assertIsString($source);
self::assertStringContainsString("->with(['user:id,name,email', 'owner:id,name,email', 'agent:id,name,email', 'status', 'priority', 'category', 'project', 'team'])", $source);
self::assertStringNotContainsString("->with(['owner', 'agent', 'status', 'priority', 'category', 'project', 'team'])", $source);
}
}