]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add JS Unit tests for new 'sendEventRemindersToSharedGroupMembers' setting. 31337/head
authorDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>
Mon, 14 Mar 2022 12:58:52 +0000 (13:58 +0100)
committerDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>
Mon, 21 Mar 2022 12:03:13 +0000 (13:03 +0100)
Signed-off-by: Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de>
apps/dav/src/views/CalDavSettings.spec.js
apps/dav/src/views/__snapshots__/CalDavSettings.spec.js.snap
apps/dav/tests/unit/Settings/CalDAVSettingsTest.php

index 951a2802182996d547a82fbbe3c2a8b28cce142a..13abca03d5b94ad6942116ed5aa6d6485d4770af 100644 (file)
@@ -45,6 +45,7 @@ describe('CalDavSettings', () => {
                                                sendInvitations: true,
                                                generateBirthdayCalendar: true,
                                                sendEventReminders: true,
+                                               sendEventRemindersToSharedGroupMembers: true,
                                                sendEventRemindersPush: true,
                                        }
                                },
@@ -66,6 +67,10 @@ describe('CalDavSettings', () => {
                        'Send notifications for events'
                )
                expect(sendEventReminders).toBeChecked()
+               const sendEventRemindersToSharedGroupMembers = TLUtils.getByLabelText(
+                       'Send reminder notifications to calendar sharees as well'
+               )
+               expect(sendEventRemindersToSharedGroupMembers).toBeChecked()
                const sendEventRemindersPush = TLUtils.getByLabelText(
                        'Enable notifications for events via push'
                )
@@ -107,7 +112,10 @@ describe('CalDavSettings', () => {
                        'sendEventReminders',
                        'no'
                )
+
+               expect(sendEventRemindersToSharedGroupMembers).toBeDisabled()
                expect(sendEventRemindersPush).toBeDisabled()
+
                OCP.AppConfig.setValue.mockClear()
                await userEvent.click(sendEventReminders)
                expect(sendEventReminders).toBeChecked()
@@ -116,6 +124,8 @@ describe('CalDavSettings', () => {
                        'sendEventReminders',
                        'yes'
                )
+
+               expect(sendEventRemindersToSharedGroupMembers).toBeEnabled()
                expect(sendEventRemindersPush).toBeEnabled()
        })
 })
index 469cd2f07eb8110e46004127b6c18e23daf2a0e5..448361297fb4cf41057c1bd964a16eb7bc123934 100644 (file)
@@ -126,7 +126,35 @@ exports[`CalDavSettings interactions 1`] = `
       </em>
     </p>
      
-    <p>
+    <p
+      class="indented"
+    >
+      <input
+        class="checkbox"
+        id="caldavSendEventRemindersToSharedGroupMembers"
+        type="checkbox"
+      />
+       
+      <label
+        for="caldavSendEventRemindersToSharedGroupMembers"
+      >
+        
+                       Send reminder notifications to calendar sharees as well
+               
+      </label>
+       
+      <br />
+       
+      <em>
+        
+                       Reminders are always sent to organizers and attendees.
+               
+      </em>
+    </p>
+     
+    <p
+      class="indented"
+    >
       <input
         class="checkbox"
         id="caldavSendEventRemindersPush"
index 3384ead652f444280e546ed3b6244e0e852b3426..4b1fad717cb2943d6987ddcc6139461574447dcc 100644 (file)
@@ -62,9 +62,10 @@ class CalDAVSettingsTest extends TestCase {
                           ['dav', 'sendInvitations', 'yes'],
                           ['dav', 'generateBirthdayCalendar', 'yes'],
                           ['dav', 'sendEventReminders', 'yes'],
+                          ['dav', 'sendEventRemindersToSharedGroupMembers', 'yes'],
                           ['dav', 'sendEventRemindersPush', 'no'],
                   )
-                  ->will($this->onConsecutiveCalls('yes', 'no', 'yes', 'yes'));
+                  ->will($this->onConsecutiveCalls('yes', 'no', 'yes', 'yes', 'yes'));
                $this->urlGenerator
                        ->expects($this->once())
                        ->method('linkToDocs')
@@ -76,6 +77,7 @@ class CalDAVSettingsTest extends TestCase {
                                ['sendInvitations', true],
                                ['generateBirthdayCalendar', false],
                                ['sendEventReminders', true],
+                               ['sendEventRemindersToSharedGroupMembers', true],
                                ['sendEventRemindersPush', true],
                        );
                $result = $this->settings->getForm();