14 lines
595 B
JavaScript
14 lines
595 B
JavaScript
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() => {
|
|
const userId = 9;
|
|
const {active, available} = await models.NotificationSubscription.getList(userId);
|
|
const notifications = await models.NotificationSubscription.getAvailable(userId);
|
|
const totalAvailable = notifications.size - active.length;
|
|
|
|
expect(active.length).toEqual(3);
|
|
expect(available.length).toEqual(totalAvailable);
|
|
});
|
|
});
|