feat(KAN-46): rebuild reusable project template management
CI/CD / preconditions (pull_request) Successful in 1s
CI/CD / test_and_check_app (pull_request) Successful in 19m8s
CI/CD / Publish immutable image (pull_request) Skipped

This commit is contained in:
2026-09-15 22:42:53 +02:00
parent b226ee8d48
commit 9a7ccb1160
12 changed files with 1322 additions and 500 deletions
@@ -163,6 +163,26 @@ class ProjectTemplateControllerTest extends TestCase
->assertNotFound();
}
public function test_unlinked_templates_can_be_updated_without_an_impact_confirmation(): void
{
$user = User::factory()->create();
$source = Project::factory()->create();
$template = ProjectTemplate::factory()->create([
'source_project_id' => $source->id,
]);
$this->syncGlobalPermissions($user, ['project:create']);
$this->actingAs($user)
->patch(route('project-templates.update', $template), [
'name' => 'Updated reusable template',
'copy_areas' => ['project_settings'],
])
->assertSessionHasNoErrors()
->assertRedirect(route('project-templates.index'));
$this->assertSame('Updated reusable template', $template->fresh()->name);
}
public function test_updating_a_template_requires_warning_acknowledgement_when_projects_are_linked(): void
{
$user = User::factory()->create();
@@ -0,0 +1,18 @@
<?php
namespace Tests\Feature\Projects;
use Symfony\Component\Process\Process;
use Tests\TestCase;
class ProjectTemplatesUiTest extends TestCase
{
public function test_template_pages_show_reusable_configuration_and_protect_linked_projects(): void
{
$process = new Process(['node', 'tests/Fixtures/project-templates.mjs'], base_path());
$process->setTimeout(60);
$process->run();
$this->assertTrue($process->isSuccessful(), $process->getOutput().$process->getErrorOutput());
$this->assertStringContainsString('Project template checks passed.', $process->getOutput());
}
}