I have tried to write a test case for alert by using Jasmine in angular 2. But any how my test case is giving an error and even though I am not sure which I have written correct approach or not. If any idea please help me out.
This is my test case:
it('checking showscheduledrequest flow an alert is called',() =>{
let component = fixture.componentInstance;
component['ou'] = 'd';
component['sen'] = 'ddsd';
var oldalert = alert;
oldalert = jasmine.createSpy();
component.handleActionChane('showscheduledrequest');
fixture.autoDetectChanges();
expect(alert).toHaveBeenCalledWith('This is not a valid request');
});