Simplify acceptance criteria checklist model
linter / quality (pull_request) Successful in 1m16s
tests / ci (8.4) (pull_request) Successful in 1m30s

This commit is contained in:
2026-05-19 22:44:28 +00:00
parent 7805bd057e
commit 689db9e41b
16 changed files with 140 additions and 363 deletions
+15 -22
View File
@@ -44,18 +44,15 @@ class TicketApiTest extends TestCase
$createResponse = $this->withApplicationKey($user)
->postJson(route('api.projects.tickets.store', $project), [
'acceptance_criteria' => [
'summary' => 'Can sign in',
'items' => [
[
'checked' => false,
'indent' => 0,
'text' => 'Credentials are validated',
],
[
'checked' => true,
'indent' => 1,
'text' => 'Nested validation is supported',
],
[
'checked' => false,
'indent' => 0,
'text' => 'Credentials are validated',
],
[
'checked' => true,
'indent' => 1,
'text' => 'Nested validation is supported',
],
],
'description' => 'Build the API-created ticket',
@@ -67,8 +64,7 @@ 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('data.acceptance_criteria.1.indent', 1)
->assertJsonPath('meta.message', 'CORE-1 was created.');
$ticket = Ticket::query()->findOrFail($createResponse->json('data.id'));
@@ -81,13 +77,10 @@ class TicketApiTest extends TestCase
$this->withApplicationKey($user)
->patchJson(route('api.projects.tickets.update', [$project, $ticket]), [
'acceptance_criteria' => [
'summary' => 'Can sign in from the API',
'items' => [
[
'checked' => true,
'indent' => 0,
'text' => 'API update preserves checked state',
],
[
'checked' => true,
'indent' => 0,
'text' => 'API update preserves checked state',
],
],
'blocked_comment' => null,
@@ -101,7 +94,7 @@ class TicketApiTest extends TestCase
])
->assertOk()
->assertJsonPath('data.title', 'Updated API ticket')
->assertJsonPath('data.acceptance_criteria.items.0.checked', true)
->assertJsonPath('data.acceptance_criteria.0.checked', true)
->assertJsonPath('meta.message', 'CORE-1 was updated.');
$this->withApplicationKey($user)