1차 보완(0.1.1+14) 내용 합치기
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:fancake/core/data/backend.dart';
|
||||
import 'package:fancake/core/monetization/rewarded_ad.dart';
|
||||
import 'package:fancake/features/quest/location_consent.dart';
|
||||
import 'package:fancake/features/quest/place_picker_screen.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart' show LatLng;
|
||||
import 'package:fancake/features/quest/quest_ad_screens.dart';
|
||||
@@ -430,9 +431,19 @@ void main() {
|
||||
// 시안 서체·입력 테마를 적용하면 폼이 길어져 기본 창에서는 이 행이 접힌다.
|
||||
await tester.ensureVisible(find.textContaining('목표 위치'));
|
||||
await tester.pumpAndSettle();
|
||||
SampleLocationConsent.shared.value = false;
|
||||
await tester.tap(find.textContaining('목표 위치'));
|
||||
await tester.pumpAndSettle();
|
||||
// 위치기반 약관(Q-E1 · R02) — 처음이면 지도 전에 묻는다. 「나중에」여도 지도에서 직접 고를 수 있다.
|
||||
expect(find.text('위치기반 서비스 이용약관'), findsOneWidget);
|
||||
await tester.tap(find.text('나중에'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(PlacePickerScreen), findsOneWidget);
|
||||
expect(
|
||||
tester.widget<PlacePickerScreen>(find.byType(PlacePickerScreen)).useDeviceLocation,
|
||||
isFalse,
|
||||
);
|
||||
expect(SampleLocationConsent.shared.records, isEmpty);
|
||||
// 위치를 정하지 않고 닫으면 장소가 비어 완료는 그대로 잠겨 있다(선택 값은 아래 위치 선택 테스트).
|
||||
await tester.tap(find.byType(CloseButton));
|
||||
await tester.pumpAndSettle();
|
||||
@@ -670,6 +681,51 @@ void main() {
|
||||
expect(find.text('광고 추가 보상 +20 기여 POP'), findsOneWidget);
|
||||
});
|
||||
});
|
||||
|
||||
group('위치기반 약관 — 위치기능 최초 사용 직전(Q-E1 · R02)', () {
|
||||
Future<_AdRepo> openPlace(WidgetTester tester) async {
|
||||
final repo = _AdRepo();
|
||||
await pumpWide(tester, QuestDetailScreen(questId: 'q4', repository: repo));
|
||||
await tester.pump();
|
||||
await tester.tap(find.widgetWithText(FilledButton, QuestStage.notStarted.buttonLabel));
|
||||
await tester.pumpAndSettle();
|
||||
return repo;
|
||||
}
|
||||
|
||||
testWidgets('「나중에」면 인증을 보내지 않고 안내만 한다 · 기록도 남기지 않는다', (tester) async {
|
||||
SampleLocationConsent.shared
|
||||
..value = false
|
||||
..records.clear();
|
||||
final repo = await openPlace(tester);
|
||||
expect(find.byKey(const ValueKey('location-terms-body')), findsOneWidget);
|
||||
await tester.tap(find.text('나중에'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(repo.verified, 0);
|
||||
expect(SampleLocationConsent.shared.records, isEmpty);
|
||||
expect(find.text('위치기반 서비스 이용약관에 동의해야 위치 인증을 할 수 있어요.'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('동의하면 기록한 뒤 인증으로 넘어가고, 다음부터는 묻지 않는다', (tester) async {
|
||||
SampleLocationConsent.shared
|
||||
..value = false
|
||||
..records.clear();
|
||||
final repo = await openPlace(tester);
|
||||
await tester.tap(find.text('동의'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(SampleLocationConsent.shared.records, [true]);
|
||||
expect(repo.verified, 1);
|
||||
});
|
||||
|
||||
testWidgets('이미 동의했으면 묻지 않는다', (tester) async {
|
||||
late BuildContext ctx;
|
||||
await pumpWide(tester, Builder(builder: (c) => (ctx = c, const SizedBox()).$2));
|
||||
final consent = SampleLocationConsent(true);
|
||||
expect(await ensureLocationConsent(ctx, consent), isTrue);
|
||||
await tester.pump();
|
||||
expect(find.byKey(const ValueKey('location-terms-body')), findsNothing);
|
||||
expect(consent.records, isEmpty);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/// 지갑이 서버 값으로 바뀐 표본 — 생성 예치 · 수수료 뒤 헤더가 다시 맞는가.
|
||||
|
||||
Reference in New Issue
Block a user