ui updates for ticket layout now with multipel attachments
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user