알림함 항목 생성 · 알림 이동 · 브리핑 항목 승인·상세 · 푸시 토픽을 가입 팬덤 전체로

This commit is contained in:
Sn-Kinos
2026-10-05 22:48:10 +09:00
parent fbf9a2c3d7
commit cf608a1d99
27 changed files with 714 additions and 69 deletions
+14
View File
@@ -1473,6 +1473,20 @@ void main() {
);
});
test('가입한 팬덤 전부의 토픽을 맞춘다 — 대표 팬덤 하나만이 아니다(C-34)', () async {
final db = await _seed();
await db.doc('users/$_uid/memberships/nj').set({'fandomId': 'nj'});
final transport = _FakeTransport();
await PushMessaging(
backend: _backend(db),
transport: transport,
).syncTopics(PushTopic.defaults);
expect(
transport.subscribed,
containsAll(['fandom_bts_briefing', 'fandom_nj_briefing']),
);
});
test('로그아웃 정리는 전 구분을 해지하고 토큰을 지운다', () async {
final db = await _seed();
final transport = _FakeTransport();
+43
View File
@@ -176,6 +176,49 @@ void main() {
expect(returned, contains('n1'));
});
testWidgets('누르면 스낵바가 아니라 대상 화면으로 간다 — 이클립스는 경로가 있어도 이동 X', (tester) async {
final opened = <String>[];
final now = DateTime.now();
await pumpWide(
tester,
NotificationTargets(
screenFor: (path) {
opened.add(path);
return Scaffold(body: Text('열린 화면 $path'));
},
child: NotificationScreen(
repository: SampleNotificationRepository(
items: [
AppNotification(
id: 'q',
kind: NotificationKind.quest,
title: '[만보기] 퀘스트를 완료했어요!',
at: now,
targetPath: 'quests/steps-1',
),
AppNotification(
id: 'e',
kind: NotificationKind.eclipse,
title: '내 행성의 이클립스가 발생했어요.',
at: now,
targetPath: 'fandoms/bts',
),
],
),
),
),
);
await tester.tap(find.text('내 행성의 이클립스가 발생했어요.'));
await tester.pumpAndSettle();
expect(find.byType(SnackBar), findsNothing);
expect(find.textContaining('열린 화면'), findsNothing);
await tester.tap(find.text('[만보기] 퀘스트를 완료했어요!'));
await tester.pumpAndSettle();
expect(find.text('열린 화면 quests/steps-1'), findsOneWidget);
expect(find.byType(SnackBar), findsNothing);
});
testWidgets('비어 있으면 그렇게 알린다', (tester) async {
await pumpWide(
tester,
+7 -1
View File
@@ -75,6 +75,7 @@ BriefingItem _brief(
sourceUrl: 'https://example.com/a',
articleUrl: 'https://example.com/a',
aiSummary: '요약입니다.',
sourceKind: 'official',
);
/// 브리핑만 갈아 끼운 표본. 「0 건이면 블록 전체 숨김」을 그 한 값으로 본다.
@@ -355,7 +356,7 @@ void main() {
expect(find.text('NEWS'), findsNothing);
});
testWidgets('줄을 누르면 원문보기로 나간다', (tester) async {
testWidgets('줄을 누르면 B-75 5 요소 상세가 뜨고, 원문 보기로 나간다', (tester) async {
final opened = <String>[];
tester.view.physicalSize = const Size(1080, 2400);
tester.view.devicePixelRatio = 2;
@@ -371,6 +372,11 @@ void main() {
));
await tester.tap(find.text('원문이 있는 줄'));
await tester.pumpAndSettle();
expect(opened, isEmpty);
expect(find.text('AI 요약'), findsOneWidget);
expect(find.textContaining('공식 출처 · '), findsOneWidget);
await tester.tap(find.text('원문 보기'));
await tester.pumpAndSettle();
expect(opened, ['https://example.com/a']);
});
}