setTimeout(60); $process->run(); $this->assertTrue($process->isSuccessful(), $process->getOutput().$process->getErrorOutput()); $this->assertStringContainsString('Ticket description checks passed.', $process->getOutput()); } public function test_markdown_descriptions_can_be_created_read_updated_and_cleared(): void { $this->withoutVite(); $user = User::factory()->create(); $project = Project::factory()->create(); app(InitializeProjectTicketMetadata::class)->handle($project); $this->syncProjectPermissions($project, $user, ['view', 'write']); $description = "## Plan\n\n**Bold** and *italic*\n\n- First\n- [Second](https://example.test)\n\n```php\necho '';\n```"; $payload = [ 'title' => 'Formatted description', 'description' => $description, 'ticket_type_id' => $project->ticketTypes()->where('is_parent', false)->firstOrFail()->id, 'ticket_priority_id' => $project->ticketPriorities()->firstOrFail()->id, 'ticket_status_id' => $project->ticketStatuses()->whereNull('board_column_id')->firstOrFail()->id, ]; $this->actingAs($user)->post(route('projects.tickets.store', $project), $payload) ->assertSessionHasNoErrors()->assertRedirect(); $ticket = $project->tickets()->sole(); $this->assertSame($description, $ticket->description); $this->get(route('projects.tickets.show', [$project, $ticket])) ->assertInertia(fn (Assert $page) => $page->where('ticket.description', $description)); $updated = "> Updated quote\n\n1. One\n2. Two\n\n`inline`"; $this->patch(route('projects.tickets.update', [$project, $ticket]), [ ...$payload, 'description' => $updated, 'is_blocked' => false, ])->assertSessionHasNoErrors()->assertRedirect(); $this->assertSame($updated, $ticket->fresh()->description); $this->patch(route('projects.tickets.update', [$project, $ticket]), [ ...$payload, 'description' => ['invalid'], 'is_blocked' => false, ])->assertSessionHasErrors('description'); $this->assertSame($updated, $ticket->fresh()->description); $this->patch(route('projects.tickets.update', [$project, $ticket]), [ ...$payload, 'description' => '', 'is_blocked' => false, ])->assertSessionHasNoErrors()->assertRedirect(); $this->assertNull($ticket->fresh()->description); } }