fix: restore summer event calculation through source deployment
Publish GitHub Pages output / publish (push) Successful in 39s
Publish GitHub Pages output / publish (push) Successful in 39s
This commit is contained in:
@@ -5,6 +5,40 @@ import { activeEventAt, compareEventRankings, eventBonusBreakdown, eventChalleng
|
||||
|
||||
const currentEvent = events[0];
|
||||
|
||||
test('솔로 이벤트는 챕터 경계에서 대상 멤버와 과제곡을 함께 전환한다', () => {
|
||||
assert.equal(activeEventAt(events, Date.parse('2026-09-19T10:59:59.999Z')), null);
|
||||
const expected = [
|
||||
[19, 'chr-00004', 'm0349'], [21, 'chr-04013', 'm0351'],
|
||||
[23, 'chr-00035', 'm0350'], [25, 'chr-03005', 'm0352']
|
||||
] as const;
|
||||
for (const [day, characterId, songId] of expected) {
|
||||
const start = Date.parse(`2026-09-${day}T11:00:00.000Z`);
|
||||
const chapter = activeEventAt(events, start)!;
|
||||
assert.deepEqual(chapter.bonusCharacterIds, [characterId]);
|
||||
assert.deepEqual(Object.keys(chapter.challengeSongBonusCardIds), [songId]);
|
||||
assert.equal(activeEventAt(events, start + 48 * 60 * 60 * 1000 - 1)?.id, chapter.id);
|
||||
assert.notEqual(activeEventAt(events, start - 1)?.id, chapter.id);
|
||||
}
|
||||
assert.equal(activeEventAt(events, Date.parse('2026-09-27T11:00:00.000Z')), null);
|
||||
});
|
||||
|
||||
test('신규 카드 공통 보너스와 현재 챕터 멤버 보너스를 따로 적용한다', () => {
|
||||
const aki = activeEventAt(events, Date.parse('2026-09-19T11:00:00Z'))!;
|
||||
const shiori = activeEventAt(events, Date.parse('2026-09-21T11:00:00Z'))!;
|
||||
const cards = [
|
||||
{ id: aki.featuredCardIds[0], characterId: 'chr-00004', rarity: 5 },
|
||||
{ id: 'shiori-regular', characterId: 'chr-04013', rarity: 3 }
|
||||
];
|
||||
assert.deepEqual(eventBonusBreakdown(aki, cards, () => 5), {
|
||||
formationPercent: 50, featuredCardPercent: 50, awakeningPercent: 33, totalPercent: 133
|
||||
});
|
||||
assert.equal(eventBonusBreakdown(shiori, [cards[0]], () => 0).totalPercent, 50);
|
||||
assert.equal(eventBonusBreakdown(shiori, [cards[1]], () => 0).totalPercent, 50);
|
||||
assert.equal(eventChallengeSongScoreBonusPercent(aki, 'm0349', [cards[0].id]), 10);
|
||||
assert.equal(eventChallengeSongScoreBonusPercent(shiori, 'm0349', [cards[0].id]), 0);
|
||||
assert.equal(eventChallengeSongScoreBonusPercent(aki, 'm0349', [aki.featuredCardIds[1]]), 0);
|
||||
});
|
||||
|
||||
test('이벤트 기간 안에서만 진행 중 이벤트를 반환한다', () => {
|
||||
assert.equal(activeEventAt(events, Date.parse('2026-08-29T02:59:59.999Z')), null);
|
||||
assert.equal(activeEventAt(events, Date.parse('2026-08-31T00:00:00.000Z'))?.id, currentEvent.id);
|
||||
|
||||
Reference in New Issue
Block a user