Show template inheritance overrides
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
|
||||
namespace Tests\Feature\Projects;
|
||||
|
||||
use App\Actions\Projects\DuplicateProjectConfiguration;
|
||||
use App\Enums\NotificationChannel;
|
||||
use App\Enums\NotificationEventType;
|
||||
use App\Models\NotificationAction;
|
||||
use App\Models\Project;
|
||||
use App\Models\ProjectTemplate;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
@@ -41,6 +43,15 @@ class ProjectNotificationSettingsControllerTest extends TestCase
|
||||
],
|
||||
]);
|
||||
|
||||
$template = ProjectTemplate::factory()->create([
|
||||
'configuration_snapshot' => app(DuplicateProjectConfiguration::class)->export($project, [
|
||||
DuplicateProjectConfiguration::COPY_NOTIFICATION_ACTIONS,
|
||||
]),
|
||||
'copy_areas' => [DuplicateProjectConfiguration::COPY_NOTIFICATION_ACTIONS],
|
||||
'name' => 'Alert Template',
|
||||
]);
|
||||
$project->update(['project_template_id' => $template->id]);
|
||||
|
||||
$this->syncProjectPermissions($project, $user, ['edit']);
|
||||
|
||||
$this->actingAs($user)
|
||||
@@ -72,6 +83,8 @@ class ProjectNotificationSettingsControllerTest extends TestCase
|
||||
->where('templateVariables.6.value', '$actor_name')
|
||||
->where('templateVariables.7.value', '$assignee_from')
|
||||
->where('templateVariables.8.value', '$assignee_to')
|
||||
->where('templateState.templateName', 'Alert Template')
|
||||
->where('templateState.inheritedAreas.0.value', DuplicateProjectConfiguration::COPY_NOTIFICATION_ACTIONS)
|
||||
->missing('notificationActions.0.delivery_url'),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user