Improve realtime chat delivery and notification events
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled
هذا الالتزام موجود في:
@@ -18,6 +18,7 @@ describe('NotificationsService', () => {
|
||||
const notificationsRepository = {
|
||||
create: jest.fn().mockResolvedValue({ toJSON: () => ({ _id: 'notification-1' }) }),
|
||||
countUnread: jest.fn().mockResolvedValue(5),
|
||||
countUnreadByFilter: jest.fn().mockResolvedValue(0),
|
||||
};
|
||||
const notificationsGateway = {
|
||||
emitCreated: jest.fn(),
|
||||
@@ -47,6 +48,7 @@ describe('NotificationsService', () => {
|
||||
const notificationsRepository = {
|
||||
markAllRead: jest.fn().mockResolvedValue(4),
|
||||
countUnread: jest.fn().mockResolvedValue(2),
|
||||
countUnreadByFilter: jest.fn().mockResolvedValue(0),
|
||||
};
|
||||
const notificationsGateway = {
|
||||
emitUnreadCount: jest.fn(),
|
||||
@@ -63,7 +65,15 @@ describe('NotificationsService', () => {
|
||||
updatedCount: 4,
|
||||
unreadCount: 2,
|
||||
});
|
||||
expect(notificationsGateway.emitUnreadCount).toHaveBeenCalledWith('user-1', 2);
|
||||
expect(notificationsGateway.emitUnreadCount).toHaveBeenCalledWith(
|
||||
'user-1',
|
||||
2,
|
||||
expect.objectContaining({
|
||||
total: 2,
|
||||
interactions: 0,
|
||||
messages: 0,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('throws not found for invalid notification id in markRead', async () => {
|
||||
@@ -330,6 +340,7 @@ describe('NotificationsService', () => {
|
||||
const notificationsRepository = {
|
||||
create: jest.fn().mockResolvedValue({ toJSON: () => ({ _id: 'notification-1' }) }),
|
||||
countUnread: jest.fn().mockResolvedValue(1),
|
||||
countUnreadByFilter: jest.fn().mockResolvedValue(0),
|
||||
};
|
||||
const notificationsGateway = {
|
||||
emitCreated: jest.fn(),
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم