Fix KAN-3 project template flows
linter / quality (pull_request) Successful in 1m31s
tests / ci (8.4) (pull_request) Successful in 1m47s

This commit is contained in:
2026-06-24 01:16:25 +02:00
parent c19cf34505
commit d250f0b380
14 changed files with 144 additions and 92 deletions
@@ -285,9 +285,8 @@ class ProjectControllerTest extends TestCase
$project->refresh();
$this->assertNotSame($template->id, $project->project_template_id);
$this->assertDatabaseHas('project_templates', [
'id' => $project->project_template_id,
$this->assertSame($template->id, $project->project_template_id);
$this->assertDatabaseMissing('project_templates', [
'project_id' => $project->id,
'is_published' => false,
]);
@@ -295,6 +294,7 @@ class ProjectControllerTest extends TestCase
$this->assertSame(false, $project->show_story_points);
$this->assertDatabaseHas('ticket_types', [
'project_id' => $project->id,
'project_template_id' => $template->id,
'name' => 'Bug',
'position' => 1,
'is_parent' => false,
@@ -661,6 +661,11 @@ class ProjectControllerTest extends TestCase
$this->assertTrue($project->show_author);
$this->assertTrue($project->show_story_points);
$this->assertSame(['Incident', 'Maintenance'], $project->ticketTypes()->pluck('name')->all());
$this->assertDatabaseHas('ticket_types', [
'project_id' => $project->id,
'project_template_id' => $newTemplate->id,
'name' => 'Incident',
]);
}
public function test_project_admins_can_reset_projects_to_their_current_template_baseline(): void
@@ -711,6 +716,11 @@ class ProjectControllerTest extends TestCase
$this->assertTrue($project->show_author);
$this->assertTrue($project->show_story_points);
$this->assertSame(['Bug', 'Feature'], $project->ticketTypes()->pluck('name')->all());
$this->assertDatabaseHas('ticket_types', [
'project_id' => $project->id,
'project_template_id' => $template->id,
'name' => 'Bug',
]);
}
public function test_project_template_switch_requires_exact_project_key_confirmation(): void