Let say i have the following code in a component, which is public and used in the view:
removeItemFromCart(item: CartItem): void {
this.store$.dispatch(OrderingStoreActions.removeItemFromCart({ cartItem: item }));
}
In the unit test, is it enough to only test that the action was dispatched?
it("should remove the item from the cart", () => {
const item = <CartItem>{ amount: 1, product: { id: "p" } };
component.removeItemFromCart(item);
expect(store.dispatch).toHaveBeenCalledWith(OrderingStoreActions.removeItemFromCart({ cartItem: item }));
});
Or should i test in the mockstore if the action result was executed on the feature store?