Denormalize profile tier fields
This commit is contained in:
1 parent
89eafb8770
commit
fafacec781
5 files changed
+76
-1
No files matched your search
@@ -670,6 +670,36 @@ describe('AnalysisPipelineService', () => {
|
||||
expect(profileSet.normalizationMethod).toBe('population-percentile');
|
||||
});
|
||||
|
||||
it('denormalizes ranked solo tier fields when storing player profiles', async () => {
|
||||
const { service, updatePlayerProfile } = createPipelineHarness({
|
||||
storedAccount: createStoredAccount({
|
||||
tiers: [
|
||||
{
|
||||
fetchedAt: new Date('2026-07-03T00:00:00.000Z'),
|
||||
leaguePoints: 987,
|
||||
losses: 10,
|
||||
queueType: 'RANKED_SOLO_5x5',
|
||||
rank: '',
|
||||
tier: 'CHALLENGER',
|
||||
wins: 20,
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
|
||||
await service.processUserAnalysisJob(createJobData(), 'analysis-job-1');
|
||||
|
||||
const profileSet = asRecord(
|
||||
asRecord(updatePlayerProfile.mock.calls[0]?.[1]).$set,
|
||||
);
|
||||
expect(profileSet).toMatchObject({
|
||||
isSeed: false,
|
||||
tier: 'CHALLENGER',
|
||||
division: '',
|
||||
leaguePoints: 987,
|
||||
});
|
||||
});
|
||||
|
||||
it('skips seed pipeline processing when the seed account is missing', async () => {
|
||||
const { findOneAccount, getMatchIds, service, updatePlayerProfile } =
|
||||
createPipelineHarness({
|
||||
|
||||
Reference in new issue
Block a user