Testing NGXS states with sub states feeds wrong state into action handler
1
1
Setup: I have a parent state defined as @State<ParentStateModel>({ name: 'grid', defaults: { parentData: 'some data' }, children: [LoadingState] }) export class ParentState { @Action(Action1) action1(ctx: stateContext<ParentStateModel>, action: Action1) { // In production this state will be ParentStateModel as expected // but in unit test, it will be of type LoadingState const state = ctx.getState(); } } And a child state defined as @State<LoadingStateModel>({ name: 'gridLoading', defaults: { loading: false } }) export class LoadingState{ @Action(Action1) action1(ctx: stateContext<LoadingStateModel>, action: Action1) { ctx.setState({loading: true}); } } Notice that both states r...