refs #4797 minor fixes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alexandre Riera 2023-05-09 14:20:20 +02:00
parent e7d16dc8ba
commit 5171e63188
2 changed files with 4 additions and 11 deletions

View File

@ -50,7 +50,7 @@ module.exports = Self => {
}
}, myOptions);
activeNotifications.forEach(subscription => {
for (subscription of activeNotifications) {
notifications.push({
id: subscription.id,
notificationFk: subscription.notificationFk,
@ -58,9 +58,9 @@ module.exports = Self => {
description: subscription.notification().description,
active: true
});
});
}
availableNotifications.forEach(acl => {
for (acl of availableNotifications) {
const activeNotif = notifications.find(
notif => notif.notificationFk === acl.notificationFk
);
@ -73,7 +73,7 @@ module.exports = Self => {
active: false,
});
}
});
}
return notifications;
};

View File

@ -28,11 +28,4 @@ describe('NotificationSubscription getList()', () => {
expect(result.filter(notification => notification.active == false).length)
.toEqual(availableNotifications.length - activeNotifications.length);
});
it('should return empty from a non existent user', async() => {
const userId = 123456789;
const result = await models.NotificationSubscription.getList(userId);
expect(result.length).toEqual(0);
});
});