feat: add match game detail analytics
This commit is contained in:
1 parent
c6da2013bd
commit
7b5604873e
18 files changed
+3452
-46
No files matched your search
@@ -29,6 +29,7 @@ describe('MatchStatsService', () => {
|
||||
connectionService,
|
||||
repository,
|
||||
{} as MatchStatsFragmentBuilder,
|
||||
{ getMatchTimeline: jest.fn() } as never,
|
||||
);
|
||||
|
||||
await service.buildAndUpsert(matchId);
|
||||
@@ -53,7 +54,20 @@ describe('MatchStatsService', () => {
|
||||
});
|
||||
const riotFind = jest.fn().mockReturnValue({
|
||||
lean: () => ({
|
||||
exec: jest.fn().mockResolvedValue([{ matchId: 'KR_1', raw: {} }]),
|
||||
exec: jest.fn().mockResolvedValue([
|
||||
{
|
||||
matchId: 'KR_1',
|
||||
raw: {},
|
||||
timeline: {
|
||||
metadata: {
|
||||
dataVersion: '2',
|
||||
matchId: 'KR_1',
|
||||
participants: [],
|
||||
},
|
||||
info: { frameInterval: 60_000, frames: [] },
|
||||
},
|
||||
},
|
||||
]),
|
||||
}),
|
||||
});
|
||||
const connectionService = {
|
||||
@@ -82,6 +96,7 @@ describe('MatchStatsService', () => {
|
||||
connectionService,
|
||||
repository,
|
||||
builder,
|
||||
{ getMatchTimeline: jest.fn() } as never,
|
||||
);
|
||||
|
||||
await service.buildAndUpsert(matchId);
|
||||
@@ -89,6 +104,8 @@ describe('MatchStatsService', () => {
|
||||
expect(builder.buildFragment).toHaveBeenCalledWith({
|
||||
match,
|
||||
rawByRiotMatchId: expect.any(Map),
|
||||
timelineByRiotMatchId: expect.any(Map),
|
||||
timelineLoadAttempted: false,
|
||||
});
|
||||
expect(repository.upsert).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
@@ -97,7 +114,7 @@ describe('MatchStatsService', () => {
|
||||
scheduledAt,
|
||||
gameCreationMin: 1_000,
|
||||
gameCreationMax: 2_000,
|
||||
builderVersion: 1,
|
||||
builderVersion: 7,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user