Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyokone committed Sep 12, 2024
1 parent 723e870 commit e826865
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void runListenTests() {
expect(initialValue.data.movies.length, 0,
reason: 'Initial movie list should be empty');

final Completer<void> isReady = Completer<void>();
final Completer<bool> hasBeenListened = Completer<bool>();
int count = 0;

Expand All @@ -37,6 +38,7 @@ void runListenTests() {
if (count == 0) {
expect(movies.length, 0,
reason: 'First emission should contain an empty list');
isReady.complete();
} else {
expect(movies.length, 1,
reason: 'Second emission should contain one movie');
Expand All @@ -47,6 +49,9 @@ void runListenTests() {
count++;
});

// Wait for the listener to be ready
await isReady.future;

// Create the movie
await MoviesConnector.instance.createMovie
.ref(
Expand Down

0 comments on commit e826865

Please sign in to comment.