From f4148820ffcbbbba9bdf9f905497ca44a023c769 Mon Sep 17 00:00:00 2001
From: Daniel Teichmann
Date: Mon, 14 Mar 2022 13:58:52 +0100
Subject: Add JS Unit tests for new 'sendEventRemindersToSharedGroupMembers'
setting.
Signed-off-by: Daniel Teichmann
---
apps/dav/src/views/CalDavSettings.spec.js | 10 ++++++++
.../__snapshots__/CalDavSettings.spec.js.snap | 30 +++++++++++++++++++++-
.../dav/tests/unit/Settings/CalDAVSettingsTest.php | 4 ++-
3 files changed, 42 insertions(+), 2 deletions(-)
(limited to 'apps/dav')
diff --git a/apps/dav/src/views/CalDavSettings.spec.js b/apps/dav/src/views/CalDavSettings.spec.js
index 951a2802182..13abca03d5b 100644
--- a/apps/dav/src/views/CalDavSettings.spec.js
+++ b/apps/dav/src/views/CalDavSettings.spec.js
@@ -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()
})
})
diff --git a/apps/dav/src/views/__snapshots__/CalDavSettings.spec.js.snap b/apps/dav/src/views/__snapshots__/CalDavSettings.spec.js.snap
index 469cd2f07eb..448361297fb 100644
--- a/apps/dav/src/views/__snapshots__/CalDavSettings.spec.js.snap
+++ b/apps/dav/src/views/__snapshots__/CalDavSettings.spec.js.snap
@@ -126,7 +126,35 @@ exports[`CalDavSettings interactions 1`] = `
-
+
+
+
+
+
+
+
+
+
+ Reminders are always sent to organizers and attendees.
+
+
+
+
+
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();
--
cgit v1.2.3