Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(notifications): allow toggling restart-limit email events

Andras Bacsaid85a7800faa7
diff --git a/app/Livewire/Notifications/Concerns/TogglesNotificationEvents.php b/app/Livewire/Notifications/Concerns/TogglesNotificationEvents.php
index decd4fe3aa..4433de0242 100644
--- a/app/Livewire/Notifications/Concerns/TogglesNotificationEvents.php
+++ b/app/Livewire/Notifications/Concerns/TogglesNotificationEvents.php
@@ -8,6 +8,7 @@ trait TogglesNotificationEvents
'deploymentSuccess',
'deploymentFailure',
'statusChange',
+ 'restartLimitReached',
'backupSuccess',
'backupFailure',
'scheduledTaskSuccess',
diff --git a/tests/Feature/Authorization/NotificationAuthorizationTest.php b/tests/Feature/Authorization/NotificationAuthorizationTest.php
index d4fa8dfc94..424696c17d 100644
--- a/tests/Feature/Authorization/NotificationAuthorizationTest.php
+++ b/tests/Feature/Authorization/NotificationAuthorizationTest.php
@@ -288,6 +288,18 @@ test('admin can update email notification settings', function () {
expect($this->admin->can('update', $settings))->toBeTrue();
});
+test('admin can disable restart limit email notifications', function () {
+ $this->actingAs($this->admin);
+ session(['currentTeam' => $this->team]);
+
+ Livewire::test(EmailNotification::class)
+ ->assertSet('restartLimitReachedEmailNotifications', true)
+ ->call('toggleEvent', 'restartLimitReachedEmailNotifications')
+ ->assertSet('restartLimitReachedEmailNotifications', false);
+
+ expect($this->team->emailNotificationSettings->fresh()->restart_limit_reached_email_notifications)->toBeFalse();
+});
+
test('admin can save team smtp settings without a resend api key when resend is disabled', function () {
$this->actingAs($this->admin);
session(['currentTeam' => $this->team]);