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
+28 -2
View File
@@ -43,7 +43,21 @@ class TicketApiTest extends TestCase
$createResponse = $this->withApplicationKey($user)
->postJson(route('api.projects.tickets.store', $project), [
'acceptance_criteria' => 'Can sign in',
'acceptance_criteria' => [
'summary' => 'Can sign in',
'items' => [
[
'checked' => false,
'indent' => 0,
'text' => 'Credentials are validated',
],
[
'checked' => true,
'indent' => 1,
'text' => 'Nested validation is supported',
],
],
],
'description' => 'Build the API-created ticket',
'story_points' => 3,
'ticket_priority_id' => $priority->id,
@@ -53,6 +67,8 @@ class TicketApiTest extends TestCase
])
->assertCreated()
->assertJsonPath('data.ticket_key', 'CORE-1')
->assertJsonPath('data.acceptance_criteria.summary', 'Can sign in')
->assertJsonPath('data.acceptance_criteria.items.1.indent', 1)
->assertJsonPath('meta.message', 'CORE-1 was created.');
$ticket = Ticket::query()->findOrFail($createResponse->json('data.id'));
@@ -64,7 +80,16 @@ class TicketApiTest extends TestCase
$this->withApplicationKey($user)
->patchJson(route('api.projects.tickets.update', [$project, $ticket]), [
'acceptance_criteria' => 'Can sign in from the API',
'acceptance_criteria' => [
'summary' => 'Can sign in from the API',
'items' => [
[
'checked' => true,
'indent' => 0,
'text' => 'API update preserves checked state',
],
],
],
'blocked_comment' => null,
'description' => 'Updated through the API',
'is_blocked' => false,
@@ -76,6 +101,7 @@ class TicketApiTest extends TestCase
])
->assertOk()
->assertJsonPath('data.title', 'Updated API ticket')
->assertJsonPath('data.acceptance_criteria.items.0.checked', true)
->assertJsonPath('meta.message', 'CORE-1 was updated.');
$this->withApplicationKey($user)