godon019
11/24/2018 - 2:31 PM

storybook example

import { compose } from 'recompose';

...

export const CartInfoContainer = compose(
    connect(
        mapStateToProps, null
    )
)
import React from 'react';
import { Provider } from 'react-redux';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { PureCartItem } from './CartItem';
import { mockedCartItem } from '../CartItemControl/CartItemControl.stories';
import { BoxDecorater } from '_helper/storybook-decorator';


// A super-simple mock of a redux store
const store = {
    getState: () => {
        return {
           
        };
    },
    subscribe: () => 0,
    dispatch: action('dispatch')
};

const props = {
    numberOfItemsInCart: 10,
};

export const actions = {
    increaseCartItemCounter: action('increaseCartItemCounter'),
};


storiesOf('CartItem', module)
    .addDecorator(story => <Provider store={store}>{story()}</Provider>)
    .addDecorator(BoxDecorater(400,400))
    .add('default', () => <PureCartItem cartItem={mockedCartItem} />);