From d69dc1d2c1d4d975bfa77796578719974d4a36cf Mon Sep 17 00:00:00 2001 From: alestiago Date: Sun, 10 Mar 2024 19:57:06 +0000 Subject: [PATCH] feat: adjust tests --- .../trashy_road/lib/src/game/bloc/game/game_state.dart | 2 +- .../test/src/maps/bloc/game_maps_state_test.dart | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/trashy_road/lib/src/game/bloc/game/game_state.dart b/packages/trashy_road/lib/src/game/bloc/game/game_state.dart index c12cbf3d..ae3f9fd6 100644 --- a/packages/trashy_road/lib/src/game/bloc/game/game_state.dart +++ b/packages/trashy_road/lib/src/game/bloc/game/game_state.dart @@ -61,7 +61,7 @@ class GameState extends Equatable { this.pausedDuration = Duration.zero, this.startedAt, this.pausedAt, - this.score = -1, + this.score, this.lostReason, }) : // TODO(alestiago): Remove magic string. diff --git a/packages/trashy_road/test/src/maps/bloc/game_maps_state_test.dart b/packages/trashy_road/test/src/maps/bloc/game_maps_state_test.dart index f3e76627..a5549d18 100644 --- a/packages/trashy_road/test/src/maps/bloc/game_maps_state_test.dart +++ b/packages/trashy_road/test/src/maps/bloc/game_maps_state_test.dart @@ -45,6 +45,14 @@ void main() { expect(rating, ScoreRating.none); }, ); + + test( + '''returns ScoreRating.none when score is null''', + () { + final rating = ScoreRating.fromSteps(score: null, steps: (1, 2, 3)); + expect(rating, ScoreRating.none); + }, + ); }); }); }