Added tests for the events operations in firebase

This commit is contained in:
Mariano Uvalle 2019-02-24 21:38:12 -06:00
parent dbdb25a6ca
commit 7e8b0b074a
3 changed files with 139 additions and 11 deletions

View file

@ -59,6 +59,7 @@ class EventModel {
mediumPriority.hashCode ^
lowPriority.hashCode;
// TODO: find a way to compare the 3 commented properties.
@override
bool operator ==(Object other) =>
identical(this, other) ||
@ -67,9 +68,9 @@ class EventModel {
id == other.id &&
name == other.name &&
pendigTasks == other.pendigTasks &&
when == other.when &&
media == other.media &&
tasks == other.tasks &&
//when == other.when &&
//media == other.media &&
//tasks == other.tasks &&
highPriority == other.highPriority &&
mediumPriority == other.mediumPriority &&
lowPriority == other.lowPriority;

View file

@ -231,12 +231,8 @@ class FirestoreProvider {
/// Returns a stream of [List<EventModel] that correspond to
/// a particular user.
Observable<List<EventModel>> getUserEvents(String userDocumentId) {
final mappedStream = firestore
.collection('users')
.document(userDocumentId)
.collection('Events')
.snapshots()
.map(
final mappedStream =
firestore.collection('users/$userDocumentId/Events').snapshots().map(
(QuerySnapshot snapshot) {
return snapshot.documents.map((DocumentSnapshot documentSnapshot) {
return EventModel.fromFirestore(