Test component with actions

In order to test components with actions you need to assign actions to component. This can be done by calling NgStateTestBed.setActionsToComponent method with actions and instance of component. Same like in Test actions just add:

beforeEach(() => {
    component = new TodoComponent();
});
const actions = ... // Create actions see example above

NgStateTestBed.setActionsToComponent(actions, component);

expect(component.actions.todoDescription).toEqual('test description');

Last updated