Skip to content

Commit

Permalink
Fixes some more async test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
astivi committed Jul 2, 2024
1 parent 1e5cc0c commit 3ae8a0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/game/components/backbox/backbox_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ void main() {
flameTester.testGameWidget(
'adds LeaderboardDisplay on LeaderboardSuccessState',
setUp: (game, _) async {
await game.onLoad();
whenListen(
bloc,
Stream<BackboxState>.empty(),
Expand All @@ -669,6 +670,7 @@ void main() {
backbox,
platformHelper: platformHelper,
);
await game.ready();
},
verify: (game, _) async {
expect(
Expand All @@ -681,6 +683,7 @@ void main() {
flameTester.testGameWidget(
'adds LeaderboardFailureDisplay on LeaderboardFailureState',
setUp: (game, _) async {
await game.onLoad();
whenListen(
bloc,
Stream<BackboxState>.empty(),
Expand All @@ -695,6 +698,7 @@ void main() {
backbox,
platformHelper: platformHelper,
);
await game.ready();
},
verify: (game, _) async {
expect(
Expand Down
6 changes: 6 additions & 0 deletions test/game/components/bottom_group_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ void main() {
flameTester.testGameWidget(
'loads correctly',
setUp: (game, _) async {
await game.onLoad();
final bottomGroup = BottomGroup();
await game.ensureAdd(
FlameBlocProvider<GameBloc, GameState>.value(
value: GameBloc(),
children: [bottomGroup],
),
);
await game.ready();
},
verify: (game, _) async {
expect(game.descendants().whereType<BottomGroup>().length, equals(1));
Expand All @@ -50,6 +52,7 @@ void main() {
flameTester.testGameWidget(
'one left flipper',
setUp: (game, _) async {
await game.onLoad();
final bottomGroup = BottomGroup();
await game.ensureAdd(
FlameBlocProvider<GameBloc, GameState>.value(
Expand All @@ -76,6 +79,7 @@ void main() {
flameTester.testGameWidget(
'one right flipper',
setUp: (game, _) async {
await game.onLoad();
final bottomGroup = BottomGroup();
await game.ensureAdd(
FlameBlocProvider<GameBloc, GameState>.value(
Expand All @@ -102,6 +106,7 @@ void main() {
flameTester.testGameWidget(
'two Baseboards',
setUp: (game, _) async {
await game.onLoad();
final bottomGroup = BottomGroup();
await game.ensureAdd(
FlameBlocProvider<GameBloc, GameState>.value(
Expand All @@ -123,6 +128,7 @@ void main() {
flameTester.testGameWidget(
'two Kickers',
setUp: (game, _) async {
await game.onLoad();
final bottomGroup = BottomGroup();
await game.ensureAdd(
FlameBlocProvider<GameBloc, GameState>.value(
Expand Down

0 comments on commit 3ae8a0c

Please sign in to comment.