Files
TicketAssistent/tests/Feature/TicketShowPageTest.php
SitiWeb c94d3f85e8 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.
2026-04-30 02:10:15 +02:00

44 lines
1.3 KiB
PHP

<?php
namespace Tests\Feature;
use App\Models\Article;
use App\Models\Ticket;
use App\Models\TicketToolCall;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class TicketShowPageTest extends TestCase
{
use RefreshDatabase;
public function test_ticket_show_renders_quick_reply_and_tool_call_sections(): void
{
$article = Article::query()->create(['title' => 'DNS', 'content' => 'x']);
$ticket = Ticket::query()->create([
'message' => 'vraag',
'status' => 'completed',
'best_article_id' => $article->id,
'support_reply' => 'Gebruik deze stappen',
'result_payload' => [
'quick_reply' => ['id' => 1, 'title' => 'DNS Quick'],
'draft_article_suggestion' => null,
],
]);
TicketToolCall::query()->create([
'ticket_id' => $ticket->id,
'article_id' => $article->id,
'action' => 'domain_inf',
'status' => 'success',
'parameters' => ['sld' => 'example', 'tld' => 'nl'],
'response' => ['ok' => true],
]);
$response = $this->get("/admin/tickets/{$ticket->id}");
$response->assertOk();
$response->assertSee('Snelantwoord gebruikt', false);
$response->assertSee('Toolcalls', false);
}
}