퀘스트 제목 다국어 · HOME 다시 읽기 · 내 퀘스트 검토 중·반려됨 구분
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:fancake/features/quest/quest_data.dart';
|
||||
import 'package:fancake/features/quest/quest_repository_firestore.dart' show questToday;
|
||||
import 'package:cloud_firestore/cloud_firestore.dart' show Timestamp;
|
||||
import 'package:fancake/features/quest/quest_repository_firestore.dart' show questTitle, questToday;
|
||||
import 'package:fancake/features/quest/widgets/quest_card_tile.dart' show questImage;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
@@ -50,4 +51,19 @@ void main() {
|
||||
);
|
||||
expect(questImage(card), 'assets/figma/quest-img-bolt.png');
|
||||
});
|
||||
|
||||
// 10/6 실기기 — 운영 Quest 제목은 언어별 지도라 HOME 카드 제목이 비었다. 타임어택은 회차 제목이 먼저다.
|
||||
test('Quest 제목 — 문자열 · 언어별 지도(앱 언어 → ko) · 열린 타임어택 회차 제목', () {
|
||||
expect(questTitle({'title': '만보기'}), '만보기');
|
||||
expect(questTitle({'title': {'en': 'Stream', 'ko': '스트리밍'}}), '스트리밍');
|
||||
expect(questTitle({'title': {'en': 'Stream'}}), 'Stream');
|
||||
final round = {
|
||||
'roundId': 'r1',
|
||||
'title': '긴급 돌발',
|
||||
'activeFrom': Timestamp.fromDate(DateTime.now().subtract(const Duration(minutes: 5))),
|
||||
'activeTo': Timestamp.fromDate(DateTime.now().add(const Duration(minutes: 5))),
|
||||
};
|
||||
expect(questTitle({'title': {'ko': '스트리밍'}, 'timeAttack': round}), '긴급 돌발');
|
||||
expect(questTitle({'title': {'ko': '스트리밍'}, 'timeAttack': {...round, 'title': ''}}), '스트리밍');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user