fix: flkay tests (#362)

pull/358/head
Erick 2 years ago committed by alestiago
parent 7d648a02e5
commit 07b8a45dd7

@ -42,6 +42,9 @@ class _TestGame extends Forge2DGame {
AndroidAcres child, {
required GameBloc gameBloc,
}) async {
// Not needed once https://github.com/flame-engine/flame/issues/1607
// is fixed
await onLoad();
await ensureAdd(
FlameBlocProvider<GameBloc, GameState>.value(
value: gameBloc,

@ -17,8 +17,11 @@ class _TestGame extends Forge2DGame {
]);
}
Future<void> pump(Multiballs child, {GameBloc? gameBloc}) {
return ensureAdd(
Future<void> pump(Multiballs child, {GameBloc? gameBloc}) async {
// Not needed once https://github.com/flame-engine/flame/issues/1607
// is fixed
await onLoad();
await ensureAdd(
FlameBlocProvider<GameBloc, GameState>.value(
value: gameBloc ?? GameBloc(),
children: [child],
@ -38,7 +41,9 @@ void main() {
(game) async {
final multiballs = Multiballs();
await game.pump(multiballs);
expect(game.descendants(), contains(multiballs));
},
verify: (game, tester) async {
expect(game.descendants().whereType<Multiballs>().length, equals(1));
},
);

Loading…
Cancel
Save