Skip to content

Commit

Permalink
Fixes Sparky Bumper Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astivi committed Jul 3, 2024
1 parent 781293e commit 989b0ed
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ void main() {
flameTester.testGameWidget(
'"a" loads correctly',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.a();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
expect(game.descendants().whereType<SparkyBumper>().length, equals(1));
Expand All @@ -40,8 +42,10 @@ void main() {
flameTester.testGameWidget(
'"b" loads correctly',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.b();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
expect(game.descendants().whereType<SparkyBumper>().length, equals(1));
Expand All @@ -51,8 +55,10 @@ void main() {
flameTester.testGameWidget(
'"c" loads correctly',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.c();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
expect(game.descendants().whereType<SparkyBumper>().length, equals(1));
Expand All @@ -62,6 +68,7 @@ void main() {
flameTester.testGameWidget(
'closes bloc when removed',
setUp: (game, _) async {
await game.onLoad();
final bloc = _MockSparkyBumperCubit();
whenListen(
bloc,
Expand All @@ -87,8 +94,10 @@ void main() {
flameTester.testGameWidget(
'a SparkyBumperBallContactBehavior',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.a();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand All @@ -105,8 +114,10 @@ void main() {
flameTester.testGameWidget(
'a SparkyBumperBlinkingBehavior',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.a();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand All @@ -125,11 +136,13 @@ void main() {
flameTester.testGameWidget(
'new children',
setUp: (game, _) async {
await game.onLoad();
final component = Component();
final sparkyBumper = SparkyBumper.a(
children: [component],
);
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand All @@ -141,8 +154,10 @@ void main() {
flameTester.testGameWidget(
'a BumpingBehavior',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.a();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand All @@ -159,11 +174,13 @@ void main() {
flameTester.testGameWidget(
'new children',
setUp: (game, _) async {
await game.onLoad();
final component = Component();
final sparkyBumper = SparkyBumper.b(
children: [component],
);
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand All @@ -175,8 +192,10 @@ void main() {
flameTester.testGameWidget(
'a BumpingBehavior',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.b();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand All @@ -192,11 +211,13 @@ void main() {
flameTester.testGameWidget(
'new children',
setUp: (game, _) async {
await game.onLoad();
final component = Component();
final sparkyBumper = SparkyBumper.c(
children: [component],
);
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand All @@ -208,8 +229,10 @@ void main() {
flameTester.testGameWidget(
'a BumpingBehavior',
setUp: (game, _) async {
await game.onLoad();
final sparkyBumper = SparkyBumper.c();
await game.ensureAdd(sparkyBumper);
await game.ready();
},
verify: (game, _) async {
final sparkyBumper =
Expand Down

0 comments on commit 989b0ed

Please sign in to comment.