pases 5 ticket updates

This commit is contained in:
Mark Gregory
2026-06-23 11:10:52 +01:00
parent 2266298b6c
commit 7c4a94b5ea
12 changed files with 312 additions and 11 deletions
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Modules\Helpdesk\tests\Feature;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
final class TicketCreateEditorSyncFilesTest extends TestCase
{
#[Test]
public function ticket_create_editor_pushes_details_body_to_livewire_before_validation(): void
{
$view = file_get_contents(base_path('Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php'));
$this->assertIsString($view);
$this->assertStringContainsString('wire:model.live="body"', $view);
$this->assertStringContainsString("window.Livewire.find(livewireId).set('body', value, false)", $view);
$this->assertStringContainsString("form.addEventListener('submit', syncBody, { capture: true })", $view);
$this->assertStringContainsString("document.addEventListener('livewire:navigated', initialiseTicketCreateEditor)", $view);
$this->assertStringContainsString("editor.addEventListener('paste', () => window.setTimeout(syncBody, 0))", $view);
}
}