fix: 베팅 후보에 종목별 핵심 능력치를 표시

전력전은 종합, 통솔전은 통솔, 일기토는 무력, 설전은 지력을 배당과 현재 투자금 옆에 표시한다. 네 종목 매핑과 desktop/mobile Chromium containment를 회귀 검사한다.
This commit is contained in:
2026-08-19 13:32:08 +00:00
parent cc1a7d8bbf
commit 8dae24a376
6 changed files with 85 additions and 4 deletions
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { buildTournamentBracket } from '../src/utils/tournamentBracket.ts';
import { buildTournamentBracket, resolveTournamentCoreStat } from '../src/utils/tournamentBracket.ts';
const participants = Array.from({ length: 16 }, (_, index) => ({
id: index + 1,
@@ -38,6 +38,15 @@ const matches = [
];
void describe('tournament bracket', () => {
void it('maps every tournament type to the legacy core stat', () => {
const participant = { leadership: 81, strength: 72, intel: 93 };
assert.deepEqual(resolveTournamentCoreStat(participant, 0), { label: '종합', value: 246 });
assert.deepEqual(resolveTournamentCoreStat(participant, 1), { label: '통솔', value: 81 });
assert.deepEqual(resolveTournamentCoreStat(participant, 2), { label: '무력', value: 72 });
assert.deepEqual(resolveTournamentCoreStat(participant, 3), { label: '지력', value: 93 });
});
void it('keeps every general in the worker roundIndex order and marks the actual winner path', () => {
const bracket = buildTournamentBracket(participants, matches, 1);