fit('should send the success response to "onSearchInsuranceSuccess"', fakeAsync(() => { spyOn(component, 'onSearchInsuranceSuccess'); insuranceServiceSpy.search.and.returnValue(Promise.resolve(insurance)); component.travelPeriod = ['01-08-2019', '01-08-09']; component.destination = 'MY'; component.tripType.individual = 'days'; component.onContinue(); fixture.detectChanges(); tick(); fixture.detectChanges(); expect(component.plans[0].plan).toEqual(insurance.data[0].plan); expect(component.benefitsList[0].title).toEqual(insurance.benefits[0].title); expect(component.onSearchInsuranceSuccess).toHaveBeenCalled(); }));