mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-24 23:40:16 -05:00
feat(notifications): allow toggling restart-limit email events
Add restartLimitReached to the notification event toggle list so admins can disable restart-limit email notifications. Cover the toggle with an authorization test.
This commit is contained in:
@@ -8,6 +8,7 @@ trait TogglesNotificationEvents
|
||||
'deploymentSuccess',
|
||||
'deploymentFailure',
|
||||
'statusChange',
|
||||
'restartLimitReached',
|
||||
'backupSuccess',
|
||||
'backupFailure',
|
||||
'scheduledTaskSuccess',
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user