You need to return something using the method subscribe, since the component calls subscribedirectly from login. The line does not work. You can simply return an object using a function subscribeand it should work
and.returnValue({ subscribe: () => {} });
Or, if you want to convey a real observation, you could
and.returnValue(Observable.of('some value'));
You may need to import rxjs/add/observable/of
source
share