Wire season flow: map screen, progress save, win recording, next stage
SaveRepository (versioned JSON over prefs) with best-result merging and unlock walking; ContentRepository loads the bundled pack; SeasonFlow/ Progress notifiers orchestrate stage start -> win record -> advance. Season map grid with stars/locks, Home -> Map -> Game navigation, close button, next-stage action on the win overlay. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import 'package:block_seasons/data/content_repository.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
test('loads the bundled Season 1 pack with 60 calibrated stages', () async {
|
||||
final repo = ContentRepository();
|
||||
final pack = await repo.loadBundledSeason('season_001');
|
||||
expect(pack.seasonId, 'season_001');
|
||||
expect(pack.stages, hasLength(60));
|
||||
expect(pack.titleFor('ko'), '첫 개화');
|
||||
|
||||
// Sanity: every stage has a positive budget and at least one objective.
|
||||
for (final stage in pack.stages) {
|
||||
expect(stage.moveLimit, greaterThan(0), reason: stage.id);
|
||||
expect(stage.objectives, isNotEmpty, reason: stage.id);
|
||||
expect(stage.stars.threeMovesLeft, greaterThan(stage.stars.twoMovesLeft),
|
||||
reason: stage.id);
|
||||
}
|
||||
});
|
||||
|
||||
test('availableSeasons returns the bundled season', () async {
|
||||
final repo = ContentRepository();
|
||||
final seasons = await repo.availableSeasons();
|
||||
expect(seasons.map((s) => s.seasonId), contains('season_001'));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user