Skip to content

Commit

Permalink
Fixes Draining Behavior tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astivi committed Jul 3, 2024
1 parent d69dbf6 commit 00b3546
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ void main() {
flameTester.testGameWidget(
'loads',
setUp: (game, _) async {
await game.onLoad();
final parent = Drain.test();
final behavior = DrainingBehavior();
await parent.add(behavior);
await game.ensureAdd(parent);
await game.ready();
},
verify: (game, _) async {
final parent = game.descendants().whereType<Drain>().single;
Expand All @@ -75,6 +77,7 @@ void main() {
flameBlocTester.testGameWidget(
'adds RoundLost when no balls left',
setUp: (game, _) async {
await game.onLoad();
final drain = Drain.test();
final behavior = DrainingBehavior();
final ball = Ball.test();
Expand All @@ -97,6 +100,7 @@ void main() {
flameBlocTester.testGameWidget(
"doesn't add RoundLost when there are balls left",
setUp: (game, _) async {
await game.onLoad();
final drain = Drain.test();
final behavior = DrainingBehavior();
final ball1 = Ball.test();
Expand All @@ -120,6 +124,7 @@ void main() {
flameBlocTester.testGameWidget(
'removes the Ball',
setUp: (game, _) async {
await game.onLoad();
final drain = Drain.test();
final behavior = DrainingBehavior();
final ball = Ball.test();
Expand Down

0 comments on commit 00b3546

Please sign in to comment.