Validation now runs only when Create Ticket is clicked.
* Removed the live body binding causing premature $commit. * Details editor still syncs before submit. * Added duplicate-submit guard. * Should no longer need clicking Save/Create twice. * Append-only changelog. * module.json version 1.9.42.
This commit is contained in:
@@ -15,9 +15,10 @@ final class TicketCreateEditorSyncFilesTest extends TestCase
|
||||
$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('wire:model="body"', $view);
|
||||
$this->assertStringContainsString("window.Livewire.find(livewireId).set('body', value, false)", $view);
|
||||
$this->assertStringContainsString("form.addEventListener('submit', syncBody, { capture: true })", $view);
|
||||
$this->assertStringNotContainsString('wire:model.live="body"', $view);
|
||||
$this->assertStringContainsString("document.addEventListener('livewire:navigated', initialiseTicketCreateEditor)", $view);
|
||||
$this->assertStringContainsString("editor.addEventListener('paste', () => window.setTimeout(syncBody, 0))", $view);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,18 @@ final class TicketCrudTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function test_ticket_create_does_not_validate_before_submit(): void
|
||||
{
|
||||
$this->seedLookupData();
|
||||
$user = $this->user();
|
||||
|
||||
Livewire::actingAs($user)
|
||||
->test(TicketCreate::class)
|
||||
->set('subject', 'Draft ticket title only')
|
||||
->assertHasNoErrors();
|
||||
}
|
||||
|
||||
public function test_ticket_create_validates_required_fields(): void
|
||||
{
|
||||
$this->seedLookupData();
|
||||
|
||||
Reference in New Issue
Block a user