workign tests
This commit is contained in:
@@ -4,16 +4,19 @@ declare(strict_types=1);
|
||||
|
||||
namespace Modules\Helpdesk\Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class TicketIndexDirectUserNPlusOneFilesTest extends TestCase
|
||||
{
|
||||
public function test_ticket_index_eager_loads_direct_user_relation(): void
|
||||
public function test_ticket_index_eager_loads_required_relations(): void
|
||||
{
|
||||
$source = file_get_contents(dirname(__DIR__, 2) . '/Livewire/TicketIndex.php');
|
||||
$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);
|
||||
|
||||
self::assertStringContainsString("->with(['status', 'priority', 'category', 'project', 'team'])", $source);
|
||||
self::assertStringNotContainsString("'user:id,name,email'", $source);
|
||||
self::assertStringNotContainsString("'owner:id,name,email'", $source);
|
||||
self::assertStringNotContainsString("'agent:id,name,email'", $source);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user