feat: expand backend admin marketplace and scaling
فشلت بعض الفحوصات
/ deploy (push) Failing after 1m22s
فشلت بعض الفحوصات
/ deploy (push) Failing after 1m22s
هذا الالتزام موجود في:
@@ -2,6 +2,35 @@ import { NotFoundException } from '@nestjs/common';
|
||||
import { NotificationsService } from './notifications.service';
|
||||
|
||||
describe('NotificationsService', () => {
|
||||
it('creates mention notifications with mention type', async () => {
|
||||
const notificationsRepository = {
|
||||
create: jest.fn().mockResolvedValue({ toJSON: () => ({ _id: 'notification-1' }) }),
|
||||
countUnread: jest.fn().mockResolvedValue(5),
|
||||
};
|
||||
const notificationsGateway = {
|
||||
emitCreated: jest.fn(),
|
||||
};
|
||||
|
||||
const service = new NotificationsService(
|
||||
notificationsRepository as any,
|
||||
notificationsGateway as any,
|
||||
);
|
||||
|
||||
await service.createMentionNotification(
|
||||
'507f1f77bcf86cd799439011',
|
||||
'507f191e810c19729de860ea',
|
||||
'507f1f77bcf86cd799439012',
|
||||
{ previewText: 'Hello @rami' },
|
||||
);
|
||||
|
||||
expect(notificationsRepository.create).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
type: 'mention',
|
||||
previewText: 'Hello @rami',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('recalculates unread count after markAllRead', async () => {
|
||||
const notificationsRepository = {
|
||||
markAllRead: jest.fn().mockResolvedValue(4),
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم