feat: enhance auction internal profile

This commit is contained in:
dahyeon committed 2026-06-24 02:47:10 -07:00
1 parent 9c69e35cfa
commit e50a683336
6 files changed
+1248 -365

No files matched your search

@@ -191,4 +191,54 @@ describe('CommunityStatsService', () => {
response,
);
});
it('includes internal match route fields in user internal history matches', async () => {
const communityId = new mongoose.Types.ObjectId();
const matchId = new mongoose.Types.ObjectId();
const userId = new mongoose.Types.ObjectId();
const participant = record(matchId);
participant.userId = userId.toString();
participant.gameNumber = 2;
participant.riotMatchId = 'KR_1234';
const cacheService = {
get: jest.fn().mockResolvedValue(null),
set: jest.fn().mockResolvedValue(undefined),
} as unknown as jest.Mocked<CommunityStatsCacheService>;
const service = new CommunityStatsService(
{} as ConnectionService,
cacheService,
{} as MatchStatsRepository,
{} as MatchStatsService,
);
(service as unknown as { buildBaseDataset: jest.Mock }).buildBaseDataset =
jest.fn().mockResolvedValue({
season: {
id: 'all',
label: '전체',
startTime: null,
endTime: null,
},
matches: [],
records: [participant],
detailsByMatchId: new Map(),
});
const response = await service.getUserInternalHistory({
communityId,
userId,
filters: { limit: 5 },
});
expect(response.matches[0]).toMatchObject({
matchId: 'KR_1234',
internalMatchId: matchId.toString(),
gameNumber: 2,
queueLabel: '내전',
});
expect(cacheService.set).toHaveBeenCalledWith(
expect.stringContaining(`userInternal:v2:${userId.toString()}`),
response,
);
});
});