2023-05-09 09:34:32 +00:00
|
|
|
const models = require('vn-loopback/server/server').models;
|
|
|
|
|
|
|
|
describe('NotificationSubscription getList()', () => {
|
|
|
|
it('should return a list of available and active notifications of a user', async() => {
|
2024-02-21 11:59:42 +00:00
|
|
|
const userId = 9;
|
|
|
|
const {active, available} = await models.NotificationSubscription.getList(userId);
|
|
|
|
const notifications = await models.NotificationSubscription.getAvailable(userId);
|
|
|
|
const totalAvailable = notifications.size - active.length;
|
2023-05-09 09:34:32 +00:00
|
|
|
|
2024-02-12 09:27:28 +00:00
|
|
|
expect(active.length).toEqual(3);
|
2023-11-08 13:57:07 +00:00
|
|
|
expect(available.length).toEqual(totalAvailable);
|
2023-05-09 09:34:32 +00:00
|
|
|
});
|
|
|
|
});
|