forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cloud_firestore] fix NoSuchMethodError regression and add test (flut…
…ter#1345) Fix cloud_firestore regression and add test
- Loading branch information
1 parent
04516a9
commit 6aef375
Showing
6 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/cloud_firestore/example/test_driver/cloud_firestore.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'dart:async'; | ||
import 'package:flutter_driver/driver_extension.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:firebase_core/firebase_core.dart'; | ||
|
||
void main() { | ||
final Completer<String> completer = Completer<String>(); | ||
enableFlutterDriverExtension(handler: (_) => completer.future); | ||
tearDownAll(() => completer.complete(null)); | ||
|
||
group('$Firestore', () { | ||
Firestore firestore; | ||
|
||
setUp(() async { | ||
final FirebaseApp app = await FirebaseApp.configure( | ||
name: 'test', | ||
options: const FirebaseOptions( | ||
googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd', | ||
gcmSenderID: '79601577497', | ||
apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU', | ||
projectID: 'flutter-firestore', | ||
), | ||
); | ||
firestore = Firestore(app: app); | ||
}); | ||
|
||
test('getDocuments', () async { | ||
final CollectionReference reference = firestore.collection('messages'); | ||
final QuerySnapshot snapshot = await reference.getDocuments(); | ||
expect(snapshot.documents.length, isNonZero); | ||
}); | ||
}); | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/cloud_firestore/example/test_driver/cloud_firestore_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:flutter_driver/flutter_driver.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
test('CloudFirestore driver test', () async { | ||
final FlutterDriver driver = await FlutterDriver.connect(); | ||
await driver.requestData(null, timeout: const Duration(minutes: 1)); | ||
driver.close(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ description: Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database | |
live synchronization and offline support on Android and iOS. | ||
author: Flutter Team <[email protected]> | ||
homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_firestore | ||
version: 0.9.6 | ||
version: 0.9.7 | ||
|
||
flutter: | ||
plugin: | ||
|
@@ -21,6 +21,9 @@ dependencies: | |
dev_dependencies: | ||
flutter_test: | ||
sdk: flutter | ||
flutter_driver: | ||
sdk: flutter | ||
test: any | ||
|
||
environment: | ||
sdk: ">=2.0.0-dev.28.0 <3.0.0" | ||
|