Remove development previews and complete hall of fame, match history, official results, and multi-kill API integration. Fix active match pagination and team-ready controls, preserve basic scoreboards, and recover statistics when Riot archives arrive. Use bounded in-process cache invalidation retries and add the Riot match lookup index migration with regression coverage.
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import type { CompetitionGameView } from '@lolympus/contracts';
|
|
import { riotMatchIdForDisplay } from '../src/lib/internal-game-evidence.ts';
|
|
|
|
test('keeps a real Riot ID visible even when analysis is missing', () => {
|
|
const game = {
|
|
gameId: 'game-1',
|
|
riotMatchId: 'KR_123',
|
|
analysisAvailability: 'missing',
|
|
};
|
|
const official = {
|
|
evidence: { type: 'riot', riotMatchId: 'KR_123' },
|
|
} as CompetitionGameView;
|
|
assert.equal(riotMatchIdForDisplay(game, official), 'KR_123');
|
|
});
|
|
|
|
test('does not label a legacy evidence reference as a Riot ID', () => {
|
|
const official = {
|
|
evidence: { type: 'legacy', legacyReference: 'KR_123' },
|
|
} as CompetitionGameView;
|
|
assert.equal(
|
|
riotMatchIdForDisplay({ riotMatchId: 'KR_123' }, official),
|
|
null,
|
|
);
|
|
assert.equal(
|
|
riotMatchIdForDisplay({ riotMatchId: 'match:legacy:123' }),
|
|
null,
|
|
);
|
|
assert.equal(riotMatchIdForDisplay({ riotMatchId: 'KR_TEMP_123' }), null);
|
|
});
|
|
|
|
test('shows a real Riot ID on unmigrated records and hides unresolved official references', () => {
|
|
assert.equal(riotMatchIdForDisplay({ riotMatchId: 'KR_123' }), 'KR_123');
|
|
assert.equal(riotMatchIdForDisplay({ riotMatchId: 'NA1_123' }), 'NA1_123');
|
|
assert.equal(
|
|
riotMatchIdForDisplay({ riotMatchId: 'KR_123', gameId: 'unresolved' }),
|
|
null,
|
|
);
|
|
});
|