cabana/src/__tests__/components/CanGraph.test.js

38 lines
974 B
JavaScript
Raw Normal View History

2017-12-12 19:27:20 -07:00
global.__JEST__ = 1;
2017-12-12 19:27:20 -07:00
import CanGraph from "../../components/CanGraph";
import React from "react";
import { shallow, mount, render } from "enzyme";
import { Provider } from "react-redux";
import createStore from "../../store";
const store = createStore();
2017-12-12 19:27:20 -07:00
test("CanGraph successfully mounts with minimal default props", () => {
const component = shallow(
<Provider store={store}>
<CanGraph
onGraphRefAvailable={() => {}}
unplot={() => {}}
messages={{}}
messageId={null}
messageName={null}
signalSpec={null}
onSegmentChanged={() => {}}
segment={[]}
data={{}}
onRelativeTimeClick={() => {}}
currentTime={0}
onDragStart={() => {}}
onDragEnd={() => {}}
container={null}
dragPos={null}
canReceiveGraphDrop={false}
plottedSignals={[]}
live={true}
/>
</Provider>
2017-12-12 19:27:20 -07:00
);
expect(component.exists()).toBe(true);
});