Merge branch 'tusharnain4578/development' into development

This commit is contained in:
Dan Brown 2023-09-17 22:29:06 +01:00
commit 684a9dee8e
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 29 additions and 14 deletions

View File

@ -20,20 +20,22 @@
'label' => trans('preferences.notifications_opt_own_page_changes'),
])
</div>
<div>
@include('form.toggle-switch', [
'name' => 'preferences[own-page-comments]',
'value' => $preferences->notifyOnOwnPageComments(),
'label' => trans('preferences.notifications_opt_own_page_comments'),
])
</div>
<div>
@include('form.toggle-switch', [
'name' => 'preferences[comment-replies]',
'value' => $preferences->notifyOnCommentReplies(),
'label' => trans('preferences.notifications_opt_comment_replies'),
])
</div>
@if (!setting('app-disable-comments'))
<div>
@include('form.toggle-switch', [
'name' => 'preferences[own-page-comments]',
'value' => $preferences->notifyOnOwnPageComments(),
'label' => trans('preferences.notifications_opt_own_page_comments'),
])
</div>
<div>
@include('form.toggle-switch', [
'name' => 'preferences[comment-replies]',
'value' => $preferences->notifyOnCommentReplies(),
'label' => trans('preferences.notifications_opt_comment_replies'),
])
</div>
@endif
</div>
<div class="mt-auto">

View File

@ -156,6 +156,19 @@ class UserPreferencesTest extends TestCase
$this->assertPermissionError($resp);
}
public function test_notification_comment_options_only_exist_if_comments_active()
{
$resp = $this->asEditor()->get('/preferences/notifications');
$resp->assertSee('Notify upon comments');
$resp->assertSee('Notify upon replies');
setting()->put('app-disable-comments', true);
$resp = $this->get('/preferences/notifications');
$resp->assertDontSee('Notify upon comments');
$resp->assertDontSee('Notify upon replies');
}
public function test_update_sort_preference()
{
$editor = $this->users->editor();