퀘스트 완료 햅틱 · HOME 행성 반응 · Push·라이브 띠 중복 제어 · 알림함 위계 · Push 탭 화면 이동

This commit is contained in:
Sn-Kinos
2026-10-08 15:48:56 +09:00
parent 0b95454b28
commit 93150a0d5b
28 changed files with 619 additions and 52 deletions
@@ -45,6 +45,8 @@ it('이클립스 발생 · 방어는 회원 전원에게 한 건씩, 재전달
const titles = items.map((n) => n.title).sort();
expect(titles).toEqual(['내 행성의 이클립스가 발생했어요.', '내 행성의 이클립스를 방어했어요.']);
expect(items.every((n) => n.eventType === 'eclipse' && n.source === 'BTS' && !n.targetPath)).toBe(true);
// 앱이 단계(발생 = 위기 · 방어 = 결과)와 행성을 가른다.
expect(items.map((n) => `${n.phase}:${n.fandomId}`).sort()).toEqual([`defended:${FANDOM}`, `start:${FANDOM}`]);
}
});
@@ -54,6 +56,7 @@ it('영웅의 선물 발동은 회원 전원에게 발동자 닉네임으로', a
expect(hero).toHaveLength(1);
expect(hero[0]!.title).toBe('팜하니짱님의 고귀한 기여로 영웅의 선물이 발동되었습니다!');
expect(hero[0]!.source).toBe('아이템');
expect(hero[0]!.fandomId).toBe(FANDOM);
});
it('퀘스트 완료는 횟수가 오른 때만 본인에게, 상세 경로를 싣는다', async () => {
@@ -74,3 +74,11 @@ it('토큰이 없으면 보내지 않는다 · 구분을 모르는 항목은 건
expect(await pushInboxItem(U, { title: 'x' })).toBeNull();
expect(sent).toHaveLength(0);
});
it('탭 이동 · C-78 단계에 쓰는 값을 싣는다 — 팬덤 · 이클립스 단계 · 캠페인 (v1.5 8장 Deep Link)', async () => {
await getFirestore().doc(`users/${U}`).set({ fcmTokens: ['t1'] });
expect(await pushInboxItem(U, { ...eclipse, fandomId: 'bts', phase: 'defended' })).toBe('sent');
expect(await pushInboxItem(U, { eventType: 'campaign', type: 'essential', title: '정산', source: '', campaignId: 'c1' })).toBe('sent');
expect(sent[0]!.data).toEqual({ category: 'fandomEvent', fandomId: 'bts', kind: 'eclipse', phase: 'defended' });
expect(sent[1]!.data).toEqual({ category: 'essential', kind: 'campaign', campaignId: 'c1' });
});