Skip to content

Commit

Permalink
chore(ui_firestore): mock Collection#snapshots() (#10146)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesnitsky committed Dec 22, 2022
1 parent dc264ed commit 4289881
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/firebase_ui_firestore/test/table_builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,25 @@ class MockAggregateQuery extends Mock implements AggregateQuery {

class MockCollection extends Mock
implements CollectionReference<Map<String, Object?>> {
@override
Stream<QuerySnapshot<Map<String, Object?>>> snapshots({
bool includeMetadataChanges = false,
}) {
return super.noSuchMethod(
Invocation.method(#snapshots, null, {
#includeMetadataChanges: includeMetadataChanges,
}),
returnValue: Stream.fromIterable([
MockQuerySnapshot(),
MockQuerySnapshot(),
]),
returnValueForMissingStub: Stream.fromIterable([
MockQuerySnapshot(),
MockQuerySnapshot(),
]),
);
}

@override
CollectionReference<R> withConverter<R extends Object?>({
FromFirestore<R>? fromFirestore,
Expand Down

0 comments on commit 4289881

Please sign in to comment.