Angular Unit Testing – Mocking AngularFireStore collection get call
I’m back with another question on how to mock a complex call from AngularFireStore.
Angular Unit Test – Mocking a function on a property
I’m trying to mock/test SendVerificationMail()
from my AuthService, which starts by calling the AngularFireAuth method currentUser
which returns an angularFire User object, which you can then use to call sendEmailVerification(). I’ve tried a few different mocking methods, but I just end up with the errors below because it can’t find user.sendEmailVerification
Angular Unit Testing – Errors on Testing Promise Rejection
I’m trying to make sure the catch block of a function on my service is covered, and I just can’t quite get it to work.
Angular Unit Testing Service – Property in service constructor not using value from spyOnProperty
I’m trying to write a negative test for my AuthService that a property in the constructor is set to null if nothing is returned from angularFireAuth. The positive side of this test case is working, and if I modify my mock file directly I can see the outcomes I want. Even with the spyOnProperty mock I have below, when I subscribe to it I can see in console logs that it’s returning null.
Angular Unit Testing – Setting a Property in Mock to Null (spyOnProperty)
I’m having trouble doing a negative test of an ngIf statement that looks at a property on my authService.
Angular Component Testing
I am trying to mock **VrskModalService **used in this component. But I am failing to mock it by providing in TestBed.configureTestingModule providers. In this component, I noticed VrskModalService is provided in its decorator not through module.
Component to test