POP 내역 총 보유 · 예약 · 사용 가능 3구분 · 온보딩 추천인 코드

This commit is contained in:
Sn-Kinos
2026-10-06 20:05:18 +09:00
parent 363c74736c
commit a04626b003
20 changed files with 235 additions and 29 deletions
+11 -1
View File
@@ -805,7 +805,17 @@ void main() {
expect([left.joined, left.passportTier, left.contributedPop, left.fandomName],
[false, PassportTier.diamond, 700, '떠난팬덤']);
expect(profile.badges.single.label, 'HEALTH · 2/7');
expect(profile.balancePop, 12540);
// 총 보유 = 일반 12,540 + 기여 300 + 예약 0(G-05).
expect(profile.balancePop, 12840);
});
test('잔액 3구분 — 총 보유 = 예약 + 사용 가능(G-05 · QA 2-29)', () async {
final db = await _seed();
await db.doc('users/$_uid/wallet/main').set({
'activityBalance': 1000, 'supportBalance': 200, 'pendingActivity': 50,
});
final profile = await FirestoreMyRepository(_backend(db)).profile();
expect([profile.balancePop, profile.reservedPop, profile.availablePop], [1250, 50, 1200]);
});
test('레벨 필드가 없으면 Lv.1 · SILVER 로 둔다', () async {
+4
View File
@@ -656,6 +656,10 @@ void main() {
expect(find.text('12,540'), findsWidgets);
expect(find.text('+50'), findsOneWidget);
expect(find.text('-500'), findsOneWidget);
// 총 보유 · 예약 · 사용 가능 세 값(G-05).
expect(find.text('총 보유'), findsOneWidget);
expect(find.text('예약'), findsOneWidget);
expect(find.text('사용 가능'), findsOneWidget);
});
testWidgets('Zap 은 건별이 아니라 당일 합산 한 줄이다', (tester) async {
+48
View File
@@ -206,6 +206,54 @@ void main() {
expect(find.byType(BackButton), findsOneWidget); // ③ 프로필로 돌아왔다.
});
testWidgets('추천인 코드(C-119) — 귀속 뒤 돌아와도 다시 부르지 않고, 다른 코드는 511:86845 문구로 거절', (
tester,
) async {
final (auth, repo) = await boot(tester, needs: true);
await auth.signIn(SocialProvider.google);
await tester.pumpAndSettle();
for (final label in [
'서비스 이용약관 (필수)',
'개인정보 수집·이용 및 처리방침 동의 (필수)',
'위치기반 서비스 이용약관 (필수)',
'만 14세 이상입니다. (필수)',
]) {
await tester.tap(find.text(label));
}
await tester.pump();
await tester.tap(find.text('완료'));
await tester.pumpAndSettle();
await tester.enterText(find.byType(TextField).first, '우주팬');
await tester.enterText(find.byType(TextField).last, 'abcdefghjk');
await tester.pump();
await tester.tap(find.text('다음'));
await tester.pumpAndSettle();
expect(repo.referral, 'ABCDEFGHJK');
// ④ → ③ : 귀속한 코드가 채워져 있고 그대로 「다음」이면 통과(두 번째 호출 없음).
await tester.tap(find.byType(BackButton));
await tester.pumpAndSettle();
expect(find.text('ABCDEFGHJK'), findsOneWidget);
// 목 저장소는 저장한 닉네임을 돌려주지 않는다 — 다시 넣는다.
await tester.enterText(find.byType(TextField).first, '우주팬');
await tester.pump();
await tester.tap(find.text('다음'));
await tester.pumpAndSettle();
expect(find.text('NewJeans'), findsOneWidget); // ④ 로 넘어갔다.
// 다른 코드로 바꾸면 서버가 1인 1회로 거절 → Figma 오류 문구, 단계는 그대로.
await tester.tap(find.byType(BackButton));
await tester.pumpAndSettle();
await tester.enterText(find.byType(TextField).first, '우주팬');
await tester.enterText(find.byType(TextField).last, 'ZZZZZZZZZZ');
await tester.pump();
await tester.tap(find.text('다음'));
await tester.pumpAndSettle();
expect(find.text('추천인 코드를 확인해 주세요.'), findsOneWidget);
expect(repo.referral, 'ABCDEFGHJK');
});
testWidgets('가입 모드에서 받은 약관은 다시 묻지 않고 기록만 한다', (tester) async {
final (auth, repo) = await boot(tester, needs: true);
auth.pendingConsent = {