2017-12-12 19:27:20 -07:00
|
|
|
global.__JEST__ = 1;
|
2017-08-08 15:30:59 -06:00
|
|
|
|
2017-12-12 19:27:20 -07:00
|
|
|
import CanGraph from "../../components/CanGraph";
|
|
|
|
import React from "react";
|
|
|
|
import { shallow, mount, render } from "enzyme";
|
2017-08-08 15:30:59 -06:00
|
|
|
|
2018-08-15 13:53:21 -06:00
|
|
|
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(
|
2018-08-15 13:53:21 -06:00
|
|
|
<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);
|
2017-08-08 15:30:59 -06:00
|
|
|
});
|