Add unit and feature tests for ticket processing and article management

- Implement Fake repositories and services for testing purposes.
- Create tests for Article API including creation, validation, and listing.
- Develop ProcessTicketJobFlowTest to validate ticket processing logic.
- Add QuickReplyAdminTest for creating and updating quick replies.
- Implement TicketAndArticleModelTest to ensure proper cascading deletes and credential encryption.
- Create TicketIngestionTest for ticket creation and job dispatching.
- Add TicketShowPageTest to verify rendering of quick replies and tool calls.
- Implement unit tests for ClassifierPromptBuilder, EmbeddingService, LlmJsonDecoder, QuickReplyResolver, SupportReplyService, TicketResultPayloadBuilder, TicketToolCallService, and ToolCallRequestValidator.
This commit is contained in:
SitiWeb
2026-04-30 02:10:15 +02:00
parent 39bdba2dfb
commit c94d3f85e8
36 changed files with 7445 additions and 467 deletions

View File

@@ -12,10 +12,14 @@
<form wire:submit="save" class="space-y-3">
<input wire:model="title" type="text" class="w-full border rounded p-2" placeholder="Titel">
@error('title') <p class="text-red-600 text-sm">{{ $message }}</p> @enderror
@error('title')
<p class="text-red-600 text-sm">{{ $message }}</p>
@enderror
<textarea wire:model="content" class="w-full border rounded p-2 min-h-36" placeholder="Snelantwoord tekst"></textarea>
@error('content') <p class="text-red-600 text-sm">{{ $message }}</p> @enderror
@error('content')
<p class="text-red-600 text-sm">{{ $message }}</p>
@enderror
<label class="flex items-center gap-2 text-sm">
<input wire:model="isActive" type="checkbox" class="rounded border-slate-300">
@@ -29,7 +33,7 @@
<div class="bg-white rounded-xl p-4 shadow">
<h2 class="font-semibold mb-3">Snelantwoorden</h2>
<div class="space-y-3">
@foreach($quickReplies as $quickReply)
@foreach ($quickReplies as $quickReply)
<div class="border rounded p-3">
<div class="flex items-start justify-between gap-3">
<div>
@@ -38,33 +42,33 @@
Gekoppeld aan {{ $quickReply->articles_count }} artikel(en)
</div>
</div>
<button
type="button"
wire:click="deleteQuickReply({{ $quickReply->id }})"
<button type="button" wire:click="deleteQuickReply({{ $quickReply->id }})"
wire:confirm="Weet je zeker dat je dit snelantwoord wilt verwijderen?"
class="text-sm text-red-600 hover:underline"
>
class="text-sm text-red-600 hover:underline">
Verwijderen
</button>
</div>
<div class="mt-3 rounded bg-slate-50 p-3 space-y-2">
<input wire:model="editRows.{{ $quickReply->id }}.title" type="text" class="w-full border rounded p-2 text-sm">
@error("editRows.{$quickReply->id}.title") <p class="text-red-600 text-sm">{{ $message }}</p> @enderror
<input wire:model="editRows.{{ $quickReply->id }}.title" type="text"
class="w-full border rounded p-2 text-sm">
@error("editRows.{$quickReply->id}.title")
<p class="text-red-600 text-sm">{{ $message }}</p>
@enderror
<textarea wire:model="editRows.{{ $quickReply->id }}.content" class="w-full border rounded p-2 min-h-28 text-sm"></textarea>
@error("editRows.{$quickReply->id}.content") <p class="text-red-600 text-sm">{{ $message }}</p> @enderror
@error("editRows.{$quickReply->id}.content")
<p class="text-red-600 text-sm">{{ $message }}</p>
@enderror
<label class="flex items-center gap-2 text-sm">
<input wire:model="editRows.{{ $quickReply->id }}.is_active" type="checkbox" class="rounded border-slate-300">
<input wire:model="editRows.{{ $quickReply->id }}.is_active" type="checkbox"
class="rounded border-slate-300">
<span>Actief</span>
</label>
<button
type="button"
wire:click="updateQuickReply({{ $quickReply->id }})"
class="text-sm px-3 py-1 rounded bg-slate-900 text-white"
>
<button type="button" wire:click="updateQuickReply({{ $quickReply->id }})"
class="text-sm px-3 py-1 rounded bg-slate-900 text-white">
Wijzigingen opslaan
</button>
</div>