Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(`will clean up Component after unmount`, function it() {
const ReduxComponent = Componentize(createStore, () => ({}), noop, noop)(() => (<div>));
const div = document.createElement(`div`);
const comp = ReactDOM.render(
, div);
ReactDOM.unmountComponentAtNode(div);
expect(comp.unsubscribeFromStore).toNotExist();
expect(comp.eventActions).toNotExist();
expect(comp.lifecycleActions).toNotExist();
expect(comp.store).toNotExist();
});
});</div>
it(`should warn and throw error`, () => {
const warningSpy = expect.spyOn(console, `error`);
expect(warningSpy).toNotHaveBeenCalled();
let error;
try {
render((
), document.createElement(`div`));
} catch (__e__) {
error = __e__;
}
expect(error).toExist();
expect(warningSpy).toHaveBeenCalled();
warningSpy.restore();
});
});
it(`returns a mixin object`, function it() {
const mixin = ReduxComponentMixin(() => ({}));
expect(mixin.getInitialState).toBeA(`function`, `and have getInitialState function`);
expect(mixin.componentWillUnmount).toBeA(
`function`, `and have componentWillUnmount function`
);
});
it(`should contain React.Component lifecycle functions`, function it() {
const ReduxComponent = Componentize(createStore, () => ({}), noop, noop)();
const comp = new ReduxComponent();
expect(comp.componentWillMount).toBeA(`function`);
expect(comp.componentDidMount).toBeA(`function`);
expect(comp.componentWillReceiveProps).toBeA(`function`);
expect(comp.componentWillUpdate).toBeA(`function`);
expect(comp.componentDidUpdate).toBeA(`function`);
expect(comp.componentWillUnmount).toBeA(`function`);
});
it('renders a container', () => {
expect(tree.type).toEqual(Base)
})
})
it('renders a container', () => {
expect(tree.type).toEqual(Base)
})
it('renders a container', () => {
expect(tree.type).toEqual(Base)
})
})
it('renders a container', () => {
expect(tree.type).toEqual(Base)
})
})
it('renders a container', () => {
expect(tree.type).toEqual(Base)
})
})
it('renders a container', () => {
expect(tree.type).toEqual(Base)
})
})