I’m having difficulty unit testing the ToastController.
I have this in my component -
let toast = this._toastCtrl.create( {
message: 'LOGIN.ASK_ENABLE_TOUCHID',
duration: 5000,
position: 'bottom',
showCloseButton: true,
closeButtonText: 'Enable'
} );
toast.present();
toast.onDidDismiss( () => {
// Some logical stuff happens here that I want to be able to test
} );
So far I am able to spyon the creation of the Toast -
spyOn( comp._toastCtrl, 'create' )
expect( comp._toastCtrl.create ).toHaveBeenCalled();
I am not sure how I test the instance of that? Can anyone point me in the right direction?
Thanks