have this function .next I have to make ONE unit test for:
I can't make that red part on imgur work .This is what I tried:
describe('ngOnInit', async () => {
beforeEach(() => {
(component as any).getTextTemplates = jasmine.createSpy();
component.msgBusService.register = jasmine.createSpy();
});
it('should getTextTemplates with searchParam', () => {
const searchParam = 'param';
component.ngOnInit();
component.getTextTemplates(searchParam);
expect(component.getTextTemplates).toHaveBeenCalledWith(searchParam);
});
});
Info: The getTextTemplates function has string as optional parameter: getTextTemplates(search?: string); Any ideas? Should I create .next somehow? Thanks.

