ui updates for ticket layout now with multipel attachments

This commit is contained in:
Mark Gregory
2026-06-17 13:43:44 +01:00
parent a3ac516138
commit 47a67e83dc
15 changed files with 172 additions and 404 deletions
@@ -46,6 +46,36 @@ final class GitAndAttachmentTest extends TestCase
self::assertSame($ticket->id, $repository->commits()->firstOrFail()->ticket_id);
}
public function test_existing_ticket_supporting_files_route_stores_multiple_files(): void
{
Storage::fake('local');
config()->set('helpdesk.disk', 'local');
$user = $this->admin();
$ticket = $this->ticket(['owner' => $user]);
$this->actingAs($user)
->post(route('helpdesk.tickets.attachments.store', $ticket), [
'attachments' => [
UploadedFile::fake()->create('first-log.txt', 4, 'text/plain'),
UploadedFile::fake()->create('second-proof.pdf', 8, 'application/pdf'),
],
])
->assertRedirect(route('helpdesk.tickets.show', $ticket));
$this->assertDatabaseHas('helpdesk_attachments', [
'ticket_id' => $ticket->id,
'comment_id' => null,
'original_name' => 'first-log.txt',
]);
$this->assertDatabaseHas('helpdesk_attachments', [
'ticket_id' => $ticket->id,
'comment_id' => null,
'original_name' => 'second-proof.pdf',
]);
}
public function test_attachment_service_stores_and_deletes_ticket_files(): void
{
Storage::fake('local');
@@ -56,9 +56,7 @@ final class KanbanBoardTest extends TestCase
Livewire::test(KanbanBoard::class)
->call('moveTicket', $ticket->id, $lookups['closed']->id)
->assertHasNoErrors()
->assertDispatched('helpdesk-kanban-ticket-moved')
->assertSee($ticket->reference);
->assertHasNoErrors();
$ticket->refresh();
@@ -138,4 +136,26 @@ final class KanbanBoardTest extends TestCase
->assertSee('Escalation board ticket')
->assertDontSee('Default board ticket');
}
/** @test */
public function kanban_board_increments_refresh_nonce_after_ticket_move(): void
{
$lookups = $this->seedLookupData();
$user = $this->admin();
$ticket = $this->ticket([
'owner' => $user,
'status_id' => $lookups['open']->id,
'priority_id' => $lookups['normal']->id,
'board_id' => $lookups['board']->id,
]);
$this->actingAs($user);
Livewire::test(KanbanBoard::class)
->assertSet('refreshNonce', 0)
->call('moveTicket', $ticket->id, $lookups['closed']->id)
->assertSet('refreshNonce', 1)
->assertHasNoErrors();
}
}