행성 Level 1~100 수치표 적용 · 행성 컬러 마스터
This commit is contained in:
@@ -109,6 +109,18 @@ void main() {
|
||||
expect(values.current.popConditionLabel, 'POP 조건 미충족');
|
||||
});
|
||||
|
||||
test('서버가 Level 판정을 적은 행성은 레벨업 POP 진행도와 다음 Stage 진입 누계로 그린다 (수치표 v1.4)', () async {
|
||||
final db = await _seed();
|
||||
// 원장 누계 growthPop 이 아니라 기준점 이후 · 가중치 반영 진행도(levelPop)를 쓴다.
|
||||
await db.doc('fandoms/bts').update({
|
||||
'level': 20, 'levelPop': 105000.5, 'nextStagePop': 110500, 'nextStageSfpi': 16575,
|
||||
});
|
||||
final home = await FirestoreHomeRepository(_backend(db)).load();
|
||||
expect(home.growth.currentPop, 105000.5);
|
||||
expect(home.growth.requiredPop, 110500);
|
||||
expect(home.growth.requiredSfpi, 16575);
|
||||
});
|
||||
|
||||
test('홈과 상세는 같은 팬덤의 서버 Stage를 표시하고 개인 Stage를 섞지 않는다', () async {
|
||||
final db = await _seed();
|
||||
await db.doc('fandoms/bts').update({'stage': 4, 'colorKey': 'gold'});
|
||||
@@ -679,9 +691,15 @@ void main() {
|
||||
await db.doc('users/$_uid').set({
|
||||
'uid': _uid, 'fandomId': 'bts', 'nickname': '아미보이',
|
||||
'totalContributedPop': 24800, 'userExp': 500000, 'userLevel': 31,
|
||||
'passportTier': 'GOLD',
|
||||
// 사용자 문서의 단일 Tier 는 읽지 않는다 — Passport 는 팬덤별 문서다(10/3 #10).
|
||||
'passportTier': 'DIAMOND',
|
||||
});
|
||||
await db.doc('fandoms/bts/members/$_uid').set({'contributedPop': 24800});
|
||||
await db.doc('users/$_uid/passports/bts').set({'tier': 'GOLD'});
|
||||
// 탈퇴한 팬덤의 Passport 도 보존 기록으로 보인다(9/21 5절).
|
||||
await db.doc('fandoms/left').set({'name': '떠난팬덤'});
|
||||
await db.doc('users/$_uid/passports/left').set({'tier': 'DIAMOND', 'contributedPop': 700});
|
||||
await db.doc('users/$_uid/badges/activity_health').set({'kind': 'activity', 'axis': 'health', 'stage': 2});
|
||||
|
||||
final profile = await FirestoreMyRepository(_backend(db)).profile();
|
||||
expect(profile.contributedPop, 24800);
|
||||
@@ -689,7 +707,13 @@ void main() {
|
||||
expect(profile.levelLabel, 'Lv.31 BEAM');
|
||||
expect(profile.userExp, 500000);
|
||||
expect(profile.passportTier, PassportTier.gold);
|
||||
expect(profile.planetTiers.single.contributedPop, 24800);
|
||||
final bts = profile.planetTiers.singleWhere((t) => t.fandomId == 'bts');
|
||||
expect(bts.contributedPop, 24800);
|
||||
expect(bts.isPrimary, isTrue);
|
||||
final left = profile.planetTiers.singleWhere((t) => t.fandomId == 'left');
|
||||
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);
|
||||
});
|
||||
|
||||
|
||||
@@ -7,6 +7,22 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
test('컬러는 마스터(config/planetColors)가 정한다 — 추가 색은 그리고 숨긴 색은 고르지 못한다 (10/3 #6)', () {
|
||||
final master = planetColorsFrom({'colors': [
|
||||
{'key': 'gold', 'hex': '#FFC500', 'visible': false},
|
||||
{'key': 'mint', 'hex': '3EB489'},
|
||||
{'key': 'bad', 'hex': 'not-a-color'},
|
||||
]});
|
||||
expect(master.visible.map((c) => c.$1), ['mint']);
|
||||
expect(master.all.map((c) => c.$1), ['gold', 'mint']);
|
||||
setPlanetColorMaster(master.all);
|
||||
addTearDown(() => setPlanetColorMaster(planetColors));
|
||||
expect(planetColorOf('mint'), const Color(0xFF3EB489));
|
||||
expect(planetColorOf('gold'), const Color(0xFFFFC500));
|
||||
// 마스터가 비면 Figma 기본 8색.
|
||||
expect(planetColorsFrom(null).visible, planetColors);
|
||||
});
|
||||
|
||||
// C-50 — 생성 화면이 고른 colorKey 를 같은 팔레트로 본체에 입힌다.
|
||||
testWidgets('행성 본체는 서버 colorKey 의 생성 팔레트 색을 입는다', (tester) async {
|
||||
expect(identical(PlanetCreateScreen.colors, planetColors), isTrue);
|
||||
|
||||
Reference in New Issue
Block a user