Add report options and profile sharing support

هذا الالتزام موجود في:
boutmoun123
2026-06-11 12:04:51 +03:00
الأصل a3628d19a2
التزام 20fe06b5ed
7 ملفات معدلة مع 186 إضافات و1 حذوفات

عرض الملف

@@ -13,3 +13,22 @@ describe('UsersController artist dashboard', () => {
expect(result).toEqual({ profile: { _id: 'user-1' } });
});
});
describe('UsersController profile lookup', () => {
it('uses the authenticated user id when loading profile overview by username', async () => {
const usersService = {
getProfileOverviewByUsername: jest.fn().mockResolvedValue({
profileShareUrl: 'https://oudelaa.com/u/artist',
}),
};
const controller = new UsersController(usersService as any);
const result = await controller.getProfileOverviewByUsername(
{ sub: 'viewer-1' } as any,
'artist',
);
expect(usersService.getProfileOverviewByUsername).toHaveBeenCalledWith('artist', 'viewer-1');
expect(result).toEqual({ profileShareUrl: 'https://oudelaa.com/u/artist' });
});
});