Add checklist acceptance criteria
linter / quality (pull_request) Successful in 1m16s
tests / ci (8.4) (pull_request) Successful in 1m33s

This commit is contained in:
2026-05-18 23:24:52 +00:00
parent f4661acf1b
commit 3ddfcc89f9
16 changed files with 937 additions and 96 deletions
@@ -56,7 +56,10 @@ class ProjectTicketControllerTest extends TestCase
'position' => 1,
]);
$legacyAcceptanceCriteria = "Review checklist\n- [ ] User can sign in\n - [x] Nested verification";
$ticket = Ticket::factory()->create([
'acceptance_criteria' => $legacyAcceptanceCriteria,
'assignee_user_id' => $assignee->id,
'author_user_id' => $author->id,
'project_id' => $project->id,
@@ -107,6 +110,14 @@ class ProjectTicketControllerTest extends TestCase
->where('project.show_author', false)
->where('ticket.ticket_key', 'CORE-1')
->where('ticket.story_points', 5)
->where('ticket.acceptance_criteria.summary', 'Review checklist')
->where('ticket.acceptance_criteria.items.0.text', 'User can sign in')
->where('ticket.acceptance_criteria.items.0.checked', false)
->where('ticket.acceptance_criteria.items.0.indent', 0)
->where('ticket.acceptance_criteria.items.1.text', 'Nested verification')
->where('ticket.acceptance_criteria.items.1.checked', true)
->where('ticket.acceptance_criteria.items.1.indent', 1)
->where('ticket.acceptance_criteria_text', $legacyAcceptanceCriteria)
->where('ticket.assignee.name', 'Assigned User')
->where('ticket.author', null)
->where('ticket.author_user_id', null)
@@ -463,9 +474,25 @@ class ProjectTicketControllerTest extends TestCase
$this->syncProjectPermissions($project, $editor, ['write', 'view']);
$updatedAcceptanceCriteria = [
'summary' => 'Updated acceptance criteria',
'items' => [
[
'text' => 'Shows success banner',
'checked' => false,
'indent' => 0,
],
[
'text' => 'Includes nested confirmations',
'checked' => true,
'indent' => 1,
],
],
];
$this->actingAs($editor)
->patch(route('projects.tickets.update', [$project, $ticket]), [
'acceptance_criteria' => 'Updated acceptance criteria',
'acceptance_criteria' => $updatedAcceptanceCriteria,
'assignee_user_id' => $assignee->id,
'blocked_comment' => $ticket->blocked_comment,
'description' => 'Updated description',
@@ -493,12 +520,16 @@ class ProjectTicketControllerTest extends TestCase
'id' => $ticket->id,
'title' => 'Updated title',
'description' => 'Updated description',
'acceptance_criteria' => 'Updated acceptance criteria',
'acceptance_criteria' => "Updated acceptance criteria\n\n- [ ] Shows success banner\n - [x] Includes nested confirmations",
'assignee_user_id' => $assignee->id,
'story_points' => 8,
'ticket_type_id' => $this->parentType($project)->id,
'ticket_priority_id' => $highPriority->id,
]);
$ticket->refresh();
$this->assertEquals($updatedAcceptanceCriteria, $ticket->acceptance_criteria_data);
$this->assertDatabaseHas('ticket_field_values', [
'ticket_id' => $ticket->id,
'ticket_field_definition_id' => $reviewerField->id,