Add JS Unit tests for new 'sendEventRemindersToSharedGroupMembers' setting.

Signed-off-by: Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de>
pull/31337/head
Daniel Teichmann 2022-03-14 13:58:52 +07:00
parent 73a7ced1fd
commit f4148820ff
No known key found for this signature in database
GPG Key ID: B500EFC78100A778
3 changed files with 42 additions and 2 deletions

@ -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()
})
})

@ -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"

@ -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();