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:
parent
361d5a3c8c
commit
d85a7800fa
2 changed files with 13 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ trait TogglesNotificationEvents
|
|||
'deploymentSuccess',
|
||||
'deploymentFailure',
|
||||
'statusChange',
|
||||
'restartLimitReached',
|
||||
'backupSuccess',
|
||||
'backupFailure',
|
||||
'scheduledTaskSuccess',
|
||||
|
|
|
|||
|
|
@ -288,6 +288,18 @@
|
|||
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]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue