Changed the [createUser] method to accept a uid for the document
This commit is contained in:
parent
0b06d86d0a
commit
5d4fa06382
3 changed files with 12 additions and 5 deletions
|
|
@ -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', () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue