fix: 토너먼트 단계를 순차 노출하고 참가 조를 표시한다
예선, 본선, 16강 영역을 실제 진행 단계부터 누적해서 보여준다. 참가 신청이 성공하면 배정된 예선 조를 선택하고 해당 표로 이동한다.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { describe, it } from 'node:test';
|
||||
import { resolveTournamentStageName } from '../src/utils/tournamentStatus.ts';
|
||||
import { resolveTournamentSectionVisibility, resolveTournamentStageName } from '../src/utils/tournamentStatus.ts';
|
||||
|
||||
void describe('tournament status labels', () => {
|
||||
void it('describes inactive and active tournament stages', () => {
|
||||
@@ -14,4 +14,32 @@ void describe('tournament status labels', () => {
|
||||
assert.equal(resolveTournamentStageName(11), '상태 확인 중');
|
||||
assert.equal(resolveTournamentStageName(-1), '상태 확인 중');
|
||||
});
|
||||
|
||||
void it('reveals tournament sections only after their stage begins and retains completed results', () => {
|
||||
assert.deepEqual(resolveTournamentSectionVisibility(0), {
|
||||
preliminary: false,
|
||||
final: false,
|
||||
knockout: false,
|
||||
});
|
||||
assert.deepEqual(resolveTournamentSectionVisibility(1), {
|
||||
preliminary: true,
|
||||
final: false,
|
||||
knockout: false,
|
||||
});
|
||||
assert.deepEqual(resolveTournamentSectionVisibility(3), {
|
||||
preliminary: true,
|
||||
final: true,
|
||||
knockout: false,
|
||||
});
|
||||
assert.deepEqual(resolveTournamentSectionVisibility(5), {
|
||||
preliminary: true,
|
||||
final: true,
|
||||
knockout: true,
|
||||
});
|
||||
assert.deepEqual(resolveTournamentSectionVisibility(0, 7), {
|
||||
preliminary: true,
|
||||
final: true,
|
||||
knockout: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user