[BREAK] Stop sending audio notifications via stream (#23108)

pull/23076/head^2
Diego Sampaio 4 years ago committed by GitHub
parent f7cce00d77
commit 6ab8225078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 49
      app/lib/server/functions/notifications/audio.js
  2. 20
      app/lib/server/lib/sendNotificationsOnMessage.js
  3. 18
      app/lib/server/startup/settings.js
  4. 3
      app/livechat/client/lib/stream/queueManager.js
  5. 75
      app/models/server/models/Subscriptions.js
  6. 15
      app/push-notifications/server/methods/saveNotificationSettings.js
  7. 41
      app/ui/client/lib/notification.js
  8. 6
      app/utils/lib/getDefaultSubscriptionPref.js
  9. 1
      app/utils/lib/getUserNotificationPreference.js
  10. 1
      client/contexts/ServerContext/methods/saveUserPreferences.ts
  11. 49
      client/startup/notifications/konchatNotifications.ts
  12. 26
      client/views/account/preferences/PreferencesNotificationsSection.js
  13. 7
      client/views/room/contextualBar/NotificationPreferences/NotificationPreferences.js
  14. 2
      client/views/room/contextualBar/NotificationPreferences/NotificationPreferences.stories.js
  15. 4
      client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.js
  16. 1
      definition/ISubscription.ts
  17. 3
      packages/rocketchat-i18n/i18n/en.i18n.json
  18. 10
      server/methods/saveUserPreferences.js
  19. 1
      server/modules/watchers/publishFields.ts
  20. 1
      server/startup/migrations/index.js
  21. 34
      server/startup/migrations/v235.ts
  22. 9
      tests/cypress/integration/11-admin.js
  23. 4
      tests/cypress/pageobjects/administration.page.js
  24. 1
      tests/end-to-end/api/00-miscellaneous.js
  25. 1
      tests/end-to-end/api/09-rooms.js

@ -1,49 +0,0 @@
import { metrics } from '../../../../metrics';
import { settings } from '../../../../settings';
import { Notifications } from '../../../../notifications';
export function shouldNotifyAudio({
disableAllMessageNotifications,
status,
statusConnection,
audioNotifications,
hasMentionToAll,
hasMentionToHere,
isHighlighted,
hasMentionToUser,
hasReplyToThread,
roomType,
isThread,
}) {
if (disableAllMessageNotifications && audioNotifications == null && !isHighlighted && !hasMentionToUser && !hasReplyToThread) {
return false;
}
if (statusConnection === 'offline' || status === 'busy' || audioNotifications === 'nothing') {
return false;
}
if (!audioNotifications) {
if (settings.get('Accounts_Default_User_Preferences_audioNotifications') === 'all' && (!isThread || hasReplyToThread)) {
return true;
}
if (settings.get('Accounts_Default_User_Preferences_audioNotifications') === 'nothing') {
return false;
}
}
return (roomType === 'd' || (!disableAllMessageNotifications && (hasMentionToAll || hasMentionToHere)) || isHighlighted || audioNotifications === 'all' || hasMentionToUser) && (!isThread || hasReplyToThread);
}
export function notifyAudioUser(userId, message, room) {
metrics.notificationsSent.inc({ notification_type: 'audio' });
Notifications.notifyUser(userId, 'audioNotification', {
payload: {
_id: message._id,
rid: message.rid,
sender: message.u,
type: room.t,
name: room.name,
},
});
}

@ -10,7 +10,6 @@ import { callJoinRoom, messageContainsHighlight, parseMessageTextPerUser, replac
import { getEmailData, shouldNotifyEmail } from '../functions/notifications/email';
import { getPushData, shouldNotifyMobile } from '../functions/notifications/mobile';
import { notifyDesktopUser, shouldNotifyDesktop } from '../functions/notifications/desktop';
import { notifyAudioUser, shouldNotifyAudio } from '../functions/notifications/audio';
import { Notification } from '../../../notification-queue/server/NotificationQueue';
import { getMentions } from './notifyUsersOnMessage';
@ -74,29 +73,11 @@ export const sendNotification = async ({
const isHighlighted = messageContainsHighlight(message, subscription.userHighlights);
const {
audioNotifications,
desktopNotifications,
mobilePushNotifications,
emailNotifications,
} = subscription;
// busy users don't receive audio notification
if (shouldNotifyAudio({
disableAllMessageNotifications,
status: receiver.status,
statusConnection: receiver.statusConnection,
audioNotifications,
hasMentionToAll,
hasMentionToHere,
isHighlighted,
hasMentionToUser,
hasReplyToThread,
roomType,
isThread,
})) {
notifyAudioUser(subscription.u._id, message, room);
}
// busy users don't receive desktop notification
if (shouldNotifyDesktop({
disableAllMessageNotifications,
@ -191,7 +172,6 @@ export const sendNotification = async ({
const project = {
$project: {
audioNotifications: 1,
desktopNotifications: 1,
emailNotifications: 1,
mobilePushNotifications: 1,

@ -259,24 +259,6 @@ settings.addGroup('Accounts', function() {
i18nLabel: 'Notification_RequireInteraction',
i18nDescription: 'Notification_RequireInteraction_Description',
});
this.add('Accounts_Default_User_Preferences_audioNotifications', 'mentions', {
type: 'select',
values: [
{
key: 'all',
i18nLabel: 'All_messages',
},
{
key: 'mentions',
i18nLabel: 'Mentions',
},
{
key: 'nothing',
i18nLabel: 'Nothing',
},
],
public: true,
});
this.add('Accounts_Default_User_Preferences_desktopNotifications', 'all', {
type: 'select',
values: [

@ -13,9 +13,8 @@ const newInquirySound = () => {
const userId = Meteor.userId();
const audioVolume = getUserPreference(userId, 'notificationsSoundVolume');
const newRoomNotification = getUserPreference(userId, 'newRoomNotification');
const audioNotificationValue = getUserPreference(userId, 'audioNotifications');
if (audioNotificationValue !== 'none') {
if (newRoomNotification !== 'none') {
CustomSounds.play(newRoomNotification, {
volume: Number((audioVolume / 100).toPrecision(2)),
});

@ -25,7 +25,6 @@ export class Subscriptions extends Base {
this.tryEnsureIndex({ alert: 1 });
this.tryEnsureIndex({ ts: 1 });
this.tryEnsureIndex({ ls: 1 });
this.tryEnsureIndex({ audioNotifications: 1 }, { sparse: 1 });
this.tryEnsureIndex({ desktopNotifications: 1 }, { sparse: 1 });
this.tryEnsureIndex({ mobilePushNotifications: 1 }, { sparse: 1 });
this.tryEnsureIndex({ emailNotifications: 1 }, { sparse: 1 });
@ -146,6 +145,20 @@ export class Subscriptions extends Base {
return this.update(query, update);
}
clearAudioNotificationValueById(_id) {
const query = {
_id,
};
const update = {
$unset: {
audioNotificationValue: 1,
},
};
return this.update(query, update);
}
updateNotificationsPrefById(_id, notificationPref, notificationField, notificationPrefOrigin) {
const query = {
_id,
@ -237,15 +250,6 @@ export class Subscriptions extends Base {
this.update(query, update);
}
findAlwaysNotifyAudioUsersByRoomId(roomId) {
const query = {
rid: roomId,
audioNotifications: 'all',
};
return this.find(query);
}
findAlwaysNotifyDesktopUsersByRoomId(roomId) {
const query = {
rid: roomId,
@ -293,57 +297,6 @@ export class Subscriptions extends Base {
return this.find(query, { fields: { emailNotifications: 1, u: 1 } });
}
findNotificationPreferencesByRoom(query/* { roomId: rid, desktopFilter: desktopNotifications, mobileFilter: mobilePushNotifications, emailFilter: emailNotifications }*/) {
return this._db.find(query, {
fields: {
// fields needed for notifications
rid: 1,
t: 1,
u: 1,
name: 1,
fname: 1,
code: 1,
// fields to define if should send a notification
ignored: 1,
audioNotifications: 1,
audioNotificationValue: 1,
desktopNotifications: 1,
mobilePushNotifications: 1,
emailNotifications: 1,
disableNotifications: 1,
muteGroupMentions: 1,
userHighlights: 1,
},
});
}
findAllMessagesNotificationPreferencesByRoom(roomId) {
const query = {
rid: roomId,
'u._id': { $exists: true },
$or: [
{ desktopNotifications: { $in: ['all', 'mentions'] } },
{ mobilePushNotifications: { $in: ['all', 'mentions'] } },
{ emailNotifications: { $in: ['all', 'mentions'] } },
],
};
return this._db.find(query, {
fields: {
'u._id': 1,
audioNotifications: 1,
audioNotificationValue: 1,
desktopNotifications: 1,
mobilePushNotifications: 1,
emailNotifications: 1,
disableNotifications: 1,
muteGroupMentions: 1,
},
});
}
resetUserE2EKey(userId) {
this.update({ 'u._id': userId }, {
$unset: {

@ -2,7 +2,11 @@ import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { Subscriptions } from '../../../models/server';
import { getUserNotificationPreference } from '../../../utils';
import { getUserNotificationPreference } from '../../../utils/server';
const saveAudioNotificationValue = (subId, value) => (value === 'default'
? Subscriptions.clearAudioNotificationValueById(subId)
: Subscriptions.updateAudioNotificationValueById(subId, value));
Meteor.methods({
saveNotificationSettings(roomId, field, value) {
@ -22,9 +26,6 @@ Meteor.methods({
};
const notifications = {
audioNotifications: {
updateMethod: (subscription, value) => Subscriptions.updateNotificationsPrefById(subscription._id, getNotificationPrefValue('audio', value), 'audioNotifications', 'audioPrefOrigin'),
},
desktopNotifications: {
updateMethod: (subscription, value) => Subscriptions.updateNotificationsPrefById(subscription._id, getNotificationPrefValue('desktop', value), 'desktopNotifications', 'desktopPrefOrigin'),
},
@ -47,12 +48,12 @@ Meteor.methods({
updateMethod: (subscription, value) => Subscriptions.updateMuteGroupMentions(subscription._id, value === '1'),
},
audioNotificationValue: {
updateMethod: (subscription, value) => Subscriptions.updateAudioNotificationValueById(subscription._id, value),
updateMethod: (subscription, value) => saveAudioNotificationValue(subscription._id, value),
},
};
const isInvalidNotification = !Object.keys(notifications).includes(field);
const basicValuesForNotifications = ['all', 'mentions', 'nothing', 'default'];
const fieldsMustHaveBasicValues = ['emailNotifications', 'audioNotifications', 'mobilePushNotifications', 'desktopNotifications'];
const fieldsMustHaveBasicValues = ['emailNotifications', 'mobilePushNotifications', 'desktopNotifications'];
if (isInvalidNotification) {
throw new Meteor.Error('error-invalid-settings', 'Invalid settings field', { method: 'saveNotificationSettings' });
@ -77,7 +78,7 @@ Meteor.methods({
if (!subscription) {
throw new Meteor.Error('error-invalid-subscription', 'Invalid subscription', { method: 'saveAudioNotificationValue' });
}
Subscriptions.updateAudioNotificationValueById(subscription._id, value);
saveAudioNotificationValue(subscription._id, value);
return true;
},
});

@ -101,24 +101,35 @@ export const KonchatNotification = {
},
newMessage(rid) {
if (!Session.equals(`user_${ Meteor.user().username }_status`, 'busy')) {
const userId = Meteor.userId();
const newMessageNotification = getUserPreference(userId, 'newMessageNotification');
const audioVolume = getUserPreference(userId, 'notificationsSoundVolume');
if (Session.equals(`user_${ Meteor.user().username }_status`, 'busy')) {
return;
}
const sub = ChatSubscription.findOne({ rid }, { fields: { audioNotificationValue: 1 } });
const userId = Meteor.userId();
const newMessageNotification = getUserPreference(userId, 'newMessageNotification');
const audioVolume = getUserPreference(userId, 'notificationsSoundVolume');
if (sub && sub.audioNotificationValue !== 'none') {
if (sub && sub.audioNotificationValue && sub.audioNotificationValue !== '0') {
CustomSounds.play(sub.audioNotificationValue, {
volume: Number((audioVolume / 100).toPrecision(2)),
});
} else if (newMessageNotification !== 'none') {
CustomSounds.play(newMessageNotification, {
volume: Number((audioVolume / 100).toPrecision(2)),
});
}
const sub = ChatSubscription.findOne({ rid }, { fields: { audioNotificationValue: 1 } });
if (!sub || sub.audioNotificationValue === 'none') {
return;
}
try {
if (sub.audioNotificationValue && sub.audioNotificationValue !== '0') {
CustomSounds.play(sub.audioNotificationValue, {
volume: Number((audioVolume / 100).toPrecision(2)),
});
return;
}
if (newMessageNotification !== 'none') {
CustomSounds.play(newMessageNotification, {
volume: Number((audioVolume / 100).toPrecision(2)),
});
}
} catch (e) {
// do nothing
}
},

@ -5,7 +5,6 @@ export const getDefaultSubscriptionPref = (userPref) => {
desktopNotifications,
mobileNotifications,
emailNotificationMode,
audioNotifications,
highlights,
} = (userPref.settings && userPref.settings.preferences) || {};
@ -28,10 +27,5 @@ export const getDefaultSubscriptionPref = (userPref) => {
subscription.emailPrefOrigin = 'user';
}
if (audioNotifications && audioNotifications !== 'default') {
subscription.audioNotifications = audioNotifications;
subscription.audioPrefOrigin = 'user';
}
return subscription;
};

@ -8,7 +8,6 @@ export const getUserNotificationPreference = (user, pref) => {
let preferenceKey;
switch (pref) {
case 'audio': preferenceKey = 'audioNotifications'; break;
case 'desktop': preferenceKey = 'desktopNotifications'; break;
case 'mobile': preferenceKey = 'pushNotifications'; break;
case 'email': preferenceKey = 'emailNotificationMode'; break;

@ -12,7 +12,6 @@ type UserPreferences = {
unreadAlert: boolean;
notificationsSoundVolume: number;
desktopNotifications: string;
audioNotifications: string;
mobileNotifications: string;
enableAutoAway: boolean;
highlights: string[];

@ -44,15 +44,24 @@ type NotificationEvent = {
};
};
type AudioNotificationEvent = {
payload: {
_id: IMessage['_id'];
rid: IMessage['rid'];
sender: IMessage['u'];
type: IRoom['t'];
name: IRoom['name'];
};
};
function notifyNewMessageAudio(rid: string): void {
const openedRoomId = Session.get('openedRoom');
// This logic is duplicated in /client/startup/unread.coffee.
const hasFocus = readMessage.isEnable();
const messageIsInOpenedRoom = openedRoomId === rid;
const muteFocusedConversations = getUserPreference(Meteor.userId(), 'muteFocusedConversations');
if (Layout.isEmbedded()) {
if (!hasFocus && messageIsInOpenedRoom) {
// Play a notification sound
KonchatNotification.newMessage(rid);
}
} else if (!hasFocus || !messageIsInOpenedRoom || !muteFocusedConversations) {
// Play a notification sound
KonchatNotification.newMessage(rid);
}
}
Meteor.startup(() => {
Tracker.autorun(() => {
@ -85,28 +94,8 @@ Meteor.startup(() => {
// Show a notification.
KonchatNotification.showDesktop(notification);
}
});
Notifications.onUser('audioNotification', (notification: AudioNotificationEvent) => {
const openedRoomId = Session.get('openedRoom');
// This logic is duplicated in /client/startup/unread.coffee.
const hasFocus = readMessage.isEnable();
const messageIsInOpenedRoom = openedRoomId === notification.payload.rid;
const muteFocusedConversations = getUserPreference(
Meteor.userId(),
'muteFocusedConversations',
);
if (Layout.isEmbedded()) {
if (!hasFocus && messageIsInOpenedRoom) {
// Play a notification sound
KonchatNotification.newMessage(notification.payload.rid);
}
} else if (!hasFocus || !messageIsInOpenedRoom || !muteFocusedConversations) {
// Play a notification sound
KonchatNotification.newMessage(notification.payload.rid);
}
notifyNewMessageAudio(notification.payload.rid);
});
CachedChatSubscription.onSyncData = ((

@ -37,14 +37,10 @@ const PreferencesNotificationsSection = ({ onChange, commitRef, ...props }) => {
const userDesktopNotifications = useUserPreference('desktopNotifications');
const userMobileNotifications = useUserPreference('pushNotifications');
const userEmailNotificationMode = useUserPreference('emailNotificationMode');
const userDesktopAudioNotifications = useUserPreference('audioNotifications');
const defaultDesktopNotifications = useSetting(
'Accounts_Default_User_Preferences_desktopNotifications',
);
const defaultDesktopAudioNotifications = useSetting(
'Accounts_Default_User_Preferences_audioNotifications',
);
const defaultMobileNotifications = useSetting(
'Accounts_Default_User_Preferences_pushNotifications',
);
@ -56,7 +52,6 @@ const PreferencesNotificationsSection = ({ onChange, commitRef, ...props }) => {
desktopNotifications: userDesktopNotifications,
mobileNotifications: userMobileNotifications,
emailNotificationMode: userEmailNotificationMode,
audioNotifications: userDesktopAudioNotifications,
},
onChange,
);
@ -66,7 +61,6 @@ const PreferencesNotificationsSection = ({ onChange, commitRef, ...props }) => {
desktopNotifications,
mobileNotifications,
emailNotificationMode,
audioNotifications,
} = values;
const {
@ -74,7 +68,6 @@ const PreferencesNotificationsSection = ({ onChange, commitRef, ...props }) => {
handleDesktopNotifications,
handleMobileNotifications,
handleEmailNotificationMode,
handleAudioNotifications,
} = handlers;
useEffect(() => setNotificationsPermission(window.Notification && Notification.permission), []);
@ -108,15 +101,6 @@ const PreferencesNotificationsSection = ({ onChange, commitRef, ...props }) => {
return optionsCp;
}, [defaultDesktopNotifications, notificationOptions, t]);
const desktopNotificationAudioOptions = useMemo(() => {
const optionsCp = notificationOptions.slice();
optionsCp.unshift([
'default',
`${t('Default')} (${t(notificationOptionsLabelMap[defaultDesktopAudioNotifications])})`,
]);
return optionsCp;
}, [defaultDesktopAudioNotifications, notificationOptions, t]);
const mobileNotificationOptions = useMemo(() => {
const optionsCp = notificationOptions.slice();
optionsCp.unshift([
@ -183,16 +167,6 @@ const PreferencesNotificationsSection = ({ onChange, commitRef, ...props }) => {
/>
</Field.Row>
</Field>
<Field>
<Field.Label>{t('Notification_Desktop_Audio_Default_For')}</Field.Label>
<Field.Row>
<Select
value={audioNotifications}
onChange={handleAudioNotifications}
options={desktopNotificationAudioOptions}
/>
</Field.Row>
</Field>
<Field>
<Field.Label>{t('Notification_Push_Default_For')}</Field.Label>
<Field.Row>

@ -52,13 +52,6 @@ const NotificationPreferences = ({
options={handleOptions.alerts}
optionDefault={formValues?.desktopAlert}
/>
<Preferences
id={'DesktopAudio'}
onChange={formHandlers?.handleDesktopAudio}
name={t('Audio')}
options={handleOptions.audio}
optionDefault={formValues?.desktopAudio}
/>
<Preferences
id={'DesktopSound'}
onChange={formHandlers?.handleDesktopSound}

@ -40,7 +40,6 @@ const handleOptions = {
const handleSelect = { desktop: {}, mobile: {}, email: {} };
handleSelect.desktop.alert = 'default';
handleSelect.desktop.audio = 'default';
handleSelect.desktop.sound = 'chime';
handleSelect.mobile.alert = 'mentions';
@ -56,7 +55,6 @@ export const Default = () => (
handleSelect={handleSelect}
handleChangeOption={{
desktopAlert: () => {},
desktopAudio: () => {},
mobileAlert: () => {},
emailAlert: () => {},
}}

@ -29,9 +29,6 @@ const NotificationPreferencesWithData = ({ rid }) => {
desktopAlert:
(subscription.desktopPrefOrigin === 'subscription' && subscription.desktopNotifications) ||
'default',
desktopAudio:
(subscription.audioPrefOrigin === 'subscription' && subscription.audioNotifications) ||
'default',
desktopSound: subscription.audioNotificationValue || 'default',
mobileAlert:
(subscription.mobilePrefOrigin === 'subscription' && subscription.mobilePushNotifications) ||
@ -68,7 +65,6 @@ const NotificationPreferencesWithData = ({ rid }) => {
notifications.muteGroupMentions = values.muteGroupMentions ? '1' : '0';
notifications.hideUnreadStatus = values.showCounter ? '0' : '1';
notifications.desktopNotifications = values.desktopAlert;
notifications.audioNotifications = values.desktopAudio;
notifications.audioNotificationValue = values.desktopSound;
notifications.mobilePushNotifications = values.mobileAlert;
notifications.emailNotifications = values.emailAlert;

@ -44,7 +44,6 @@ export interface ISubscription extends IRocketChatRecord {
code?: unknown;
archived?: unknown;
audioNotifications?: unknown;
audioNotificationValue?: unknown;
desktopNotifications?: unknown;
mobilePushNotifications?: unknown;

@ -3062,7 +3062,6 @@
"Nothing_found": "Nothing found",
"Notice_that_public_channels_will_be_public_and_visible_to_everyone": "Notice that public Channels will be public and visible to everyone.",
"Notification_Desktop_Default_For": "Show Desktop Notifications For",
"Notification_Desktop_Audio_Default_For": "Play Desktop Notifications Audio For",
"Notification_Push_Default_For": "Send Push Notifications For",
"Notification_RequireInteraction": "Require Interaction to Dismiss Desktop Notification",
"Notification_RequireInteraction_Description": "Works only with Chrome browser versions > 50. Utilizes the parameter <i>requireInteraction</i> to show the desktop notification to indefinite until the user interacts with it.",
@ -4643,4 +4642,4 @@
"Your_temporary_password_is_password": "Your temporary password is <strong>[password]</strong>.",
"Your_TOTP_has_been_reset": "Your Two Factor TOTP has been reset.",
"Your_workspace_is_ready": "Your workspace is ready to use 🎉"
}
}

@ -19,7 +19,6 @@ Meteor.methods({
unreadAlert: Match.Optional(Boolean),
notificationsSoundVolume: Match.Optional(Number),
desktopNotifications: Match.Optional(String),
audioNotifications: Match.Optional(String),
mobileNotifications: Match.Optional(String),
enableAutoAway: Match.Optional(Boolean),
highlights: Match.Optional([String]),
@ -49,7 +48,6 @@ Meteor.methods({
desktopNotifications: oldDesktopNotifications,
mobileNotifications: oldMobileNotifications,
emailNotificationMode: oldEmailNotifications,
audioNotifications: oldAudioNotifications,
} = (user.settings && user.settings.preferences) || {};
if (user.settings == null) {
@ -99,14 +97,6 @@ Meteor.methods({
}
}
if (settings.audioNotifications && oldAudioNotifications !== settings.audioNotifications) {
if (settings.audioNotifications === 'default') {
Subscriptions.clearNotificationUserPreferences(user._id, 'audioNotifications', 'audioPrefOrigin');
} else {
Subscriptions.updateNotificationUserPreferences(user._id, settings.audioNotifications, 'audioNotifications', 'audioPrefOrigin');
}
}
if (Array.isArray(settings.highlights)) {
Subscriptions.updateUserHighlights(user._id, settings.highlights);
}

@ -17,7 +17,6 @@ export const subscriptionFields = {
userMentions: 1,
groupMentions: 1,
archived: 1,
audioNotifications: 1,
audioNotificationValue: 1,
desktopNotifications: 1,
mobilePushNotifications: 1,

@ -231,4 +231,5 @@ import './v231';
import './v232';
import './v233';
import './v234';
import './v235';
import './xrun';

@ -0,0 +1,34 @@
import { Migrations } from '../../../app/migrations/server';
import { Settings, Subscriptions, Users } from '../../../app/models/server';
Migrations.add({
version: 235,
up() {
Settings.removeById('Accounts_Default_User_Preferences_audioNotifications');
// delete field from subscriptions
Subscriptions.update({
audioNotifications: {
$exists: true,
},
}, {
$unset: {
audioNotifications: 1,
audioPrefOrigin: 1,
},
}, { multi: true });
Subscriptions.tryDropIndex({ audioNotifications: 1 });
// delete field from users
Users.update({
'settings.preferences.audioNotifications': {
$exists: true,
},
}, {
$unset: {
'settings.preferences.audioNotifications': 1,
},
}, { multi: true });
},
});

@ -687,15 +687,6 @@ describe('[Administration]', () => {
admin.accountsidleTimeLimit.should('have.value', '300');
});
it('it should show the audio notifications select field', () => {
admin.accountsAudioNotifications.scrollIntoView();
admin.accountsAudioNotifications.should('be.visible');
});
it('the audio notifications field value should be mentions', () => {
admin.accountsAudioNotifications.should('have.value', 'mentions');
});
it('it should show the desktop audio notifications select field', () => {
admin.accountsDesktopNotifications.scrollIntoView();
admin.accountsDesktopNotifications.should('be.visible');

@ -234,10 +234,6 @@ class Administration extends Page {
get accountsidleTimeLimitReset() { return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_idleTimeLimit"]'); }
get accountsAudioNotifications() { return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_audioNotifications"]'); }
get accountsAudioNotificationsReset() { return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_audioNotifications"]'); }
get accountsDesktopNotifications() { return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_desktopNotifications"]'); }
get accountsDesktopNotificationsReset() { return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_desktopNotifications"]'); }

@ -130,7 +130,6 @@ describe('miscellaneous', function() {
.expect(200)
.expect((res) => {
const allUserPreferencesKeys = [
'audioNotifications',
// 'language',
'newRoomNotification',
'newMessageNotification',

@ -59,7 +59,6 @@ describe('[Rooms]', function() {
emailNotifications: 'nothing',
audioNotificationValue: 'beep',
desktopNotifications: 'nothing',
audioNotifications: 'all',
mobilePushNotifications: 'mentions',
},
})

Loading…
Cancel
Save