Show all metric insights with descriptions

This commit is contained in:
dahyeon committed 2026-07-03 02:44:00 -07:00
1 parent 741fce0adb
commit cfbc74d882
9 files changed
+171 -33

No files matched your search

@@ -144,15 +144,25 @@ describe('AnalysisReadService', () => {
(metric) => metric.metricId === 'deathWithShutdownBountyGivenRate',
),
).toBe(false);
expect(analysis.strengths).toEqual([
expect(analysis.strengths).toHaveLength(12);
expect(analysis.weaknesses).toHaveLength(12);
expect(analysis.strengths.slice(0, 3)).toEqual([
{ metricId: 'deathsPerMin', value: 0.1 },
{ metricId: 'kda', value: 0.8 },
{ metricId: 'killParticipation', value: 0.7 },
]);
expect(analysis.weaknesses).toEqual([
expect(analysis.strengths.at(-1)).toEqual({
metricId: 'wardsKilledPerMin',
value: 0.1,
});
expect(analysis.weaknesses.slice(0, 3)).toEqual([
{ metricId: 'wardsKilledPerMin', value: 0.1 },
{ metricId: 'visionScorePerMin', value: 0.2 },
{ metricId: 'controlWardsPlaced', value: 0.2 },
]);
expect(analysis.weaknesses.at(-1)).toEqual({
metricId: 'deathsPerMin',
value: 0.1,
});
});
});
@@ -201,7 +201,6 @@ export class AnalysisReadService {
? right.score - left.score
: left.score - right.score,
)
.slice(0, 3)
.map(({ metricId, value }) => ({ metricId, value }));
}
+2 -1
View File
@@ -185,7 +185,8 @@ describe('shared feature registry', () => {
expect(new Set(metricIds).size).toBe(metricIds.length);
for (const metric of METRICS) {
expect(metric.label).toBeTruthy();
expect(metric.label.trim()).toBeTruthy();
expect(metric.description.trim()).toBeTruthy();
expect(metric.baseline).toBeDefined();
expect(Object.keys(metric.baseline ?? {}).sort()).toEqual([
'BOTTOM',