Changed the [createUser] method to accept a uid for the document

This commit is contained in:
Mariano Uvalle 2019-03-05 20:06:05 -06:00
parent 0b06d86d0a
commit 5d4fa06382
3 changed files with 12 additions and 5 deletions

View file

@ -47,13 +47,15 @@ main() {
test('should create a user', () {
final firestore = MockFirestore();
final collection = MockCollectionReference();
final document = MockDocumentReference();
final provider = FirestoreProvider(firestore);
when(firestore.collection('users')).thenReturn(collection);
when(collection.document('123')).thenReturn(document);
provider.createUser(user);
provider.createUser(user, '123');
verify(collection.add(user.toFirestoreMap()));
verify(document.setData(user.toFirestoreMap()));
});
test('should update the information of a user', () {