feat: refresh the home page and separate match event types
Add an inhouse hero, Hall of Fame, rankings, and event-specific schedules. Carry the event type through the API and admin tools, and improve results and player history displays.
This commit is contained in:
1 parent
7e0cd7cb19
commit
664af15255
58 files changed
+2316
-593
No files matched your search
@@ -1,9 +1,11 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import type { MatchParticipantView } from '@lolympus/contracts';
|
||||
import {
|
||||
getHistoryMatchTitle,
|
||||
getHomeMatchEnrollment,
|
||||
getHomeMatchSchedule,
|
||||
getNextMatchBanner,
|
||||
} from '../src/pages/home-match-presentation.ts';
|
||||
|
||||
test('uses the Korean schedule and only removes a matching generic title prefix', () => {
|
||||
@@ -48,3 +50,34 @@ test('promotes application only for an open match with available places', () =>
|
||||
'참가 완료',
|
||||
);
|
||||
});
|
||||
|
||||
test('uses neutral titles and distinguishes registration states on the next match banner', () => {
|
||||
const match = {
|
||||
title: '토요일 내전',
|
||||
status: 'recruiting' as const,
|
||||
joined: false,
|
||||
maxParticipants: 1,
|
||||
participants: [],
|
||||
};
|
||||
const participant: MatchParticipantView = {
|
||||
userId: 'player-1' as MatchParticipantView['userId'],
|
||||
joinedAt: '2026-11-10T09:00:00.000Z',
|
||||
preferredPositions: [],
|
||||
excluded: false,
|
||||
};
|
||||
|
||||
assert.deepEqual(getNextMatchBanner(match), {
|
||||
title: '정기 내전',
|
||||
status: '모집 중',
|
||||
capacity: '0/1명',
|
||||
canApply: true,
|
||||
});
|
||||
const fullMatch = { ...match, participants: [participant] };
|
||||
assert.equal(getNextMatchBanner(fullMatch).status, '정원 마감');
|
||||
assert.equal(getNextMatchBanner({ ...fullMatch, joined: true }).status, '신청 완료');
|
||||
assert.equal(getNextMatchBanner({ ...match, maxParticipants: 0 }).status, '모집 마감');
|
||||
assert.deepEqual(
|
||||
getNextMatchBanner({ ...fullMatch, title: '토요일 시즌 결승 내전', status: 'team-built' }),
|
||||
{ title: '토요일 시즌 결승 내전', status: '팀 편성', capacity: '1/1명', canApply: false },
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user