Skip to content

Commit

Permalink
Fixes Android Bumper tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astivi committed Jul 3, 2024
1 parent 19b0751 commit cf3b00c
Showing 1 changed file with 22 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 androidBumper = AndroidBumper.a();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
expect(game.descendants().whereType<AndroidBumper>(), isNotEmpty);
Expand All @@ -40,8 +42,10 @@ void main() {
flameTester.testGameWidget(
'"b" loads correctly',
setUp: (game, _) async {
await game.onLoad();
final androidBumper = AndroidBumper.b();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
expect(game.descendants().whereType<AndroidBumper>(), isNotEmpty);
Expand All @@ -51,8 +55,10 @@ void main() {
flameTester.testGameWidget(
'"cow" loads correctly',
setUp: (game, _) async {
await game.onLoad();
final androidBumper = AndroidBumper.cow();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
expect(game.descendants().whereType<AndroidBumper>(), isNotEmpty);
Expand All @@ -62,6 +68,7 @@ void main() {
flameTester.testGameWidget(
'closes bloc when removed',
setUp: (game, _) async {
await game.onLoad();
final bloc = _MockAndroidBumperCubit();
whenListen(
bloc,
Expand Down Expand Up @@ -89,8 +96,10 @@ void main() {
flameTester.testGameWidget(
'an AndroidBumperBallContactBehavior',
setUp: (game, _) async {
await game.onLoad();
final androidBumper = AndroidBumper.a();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
final androidBumper =
Expand All @@ -106,8 +115,10 @@ void main() {
flameTester.testGameWidget(
'an AndroidBumperBlinkingBehavior',
setUp: (game, _) async {
await game.onLoad();
final androidBumper = AndroidBumper.a();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
final androidBumper =
Expand All @@ -126,6 +137,7 @@ void main() {
flameTester.testGameWidget(
'new children',
setUp: (game, _) async {
await game.onLoad();
final component = Component();
final androidBumper = AndroidBumper.a(
children: [component],
Expand All @@ -143,8 +155,10 @@ void main() {
flameTester.testGameWidget(
'a BumpingBehavior',
setUp: (game, _) async {
await game.onLoad();
final androidBumper = AndroidBumper.a();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
final androidBumper =
Expand All @@ -161,11 +175,13 @@ void main() {
flameTester.testGameWidget(
'new children',
setUp: (game, _) async {
await game.onLoad();
final component = Component();
final androidBumper = AndroidBumper.b(
children: [component],
);
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
final androidBumper =
Expand All @@ -177,8 +193,10 @@ void main() {
flameTester.testGameWidget(
'a BumpingBehavior',
setUp: (game, _) async {
await game.onLoad();
final androidBumper = AndroidBumper.b();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
final androidBumper =
Expand All @@ -195,11 +213,13 @@ void main() {
flameTester.testGameWidget(
'new children',
setUp: (game, _) async {
await game.onLoad();
final component = Component();
final androidBumper = AndroidBumper.cow(
children: [component],
);
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
final androidBumper =
Expand All @@ -211,8 +231,10 @@ void main() {
flameTester.testGameWidget(
'a BumpingBehavior',
setUp: (game, _) async {
await game.onLoad();
final androidBumper = AndroidBumper.cow();
await game.ensureAdd(androidBumper);
await game.ready();
},
verify: (game, _) async {
final androidBumper =
Expand Down

0 comments on commit cf3b00c

Please sign in to comment.