12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- const data = [
- [1543276800000, 0],
- [1543363200000, 0],
- [1543449600000, 36],
- [1543536000000, 40],
- [1543622400000, 0],
- [1543708800000, 17],
- [1543795200000, 104],
- [1543881600000, 13],
- ];
- const model = {
- _payload: {
- batch: [
- {
- startValue: 1543449600000,
- endValue: 1543708800000,
- },
- ],
- },
- series: [
- {
- data,
- },
- ],
- };
- export const chart = {
- getModel: jest.fn(() => ({option: model})),
- };
- // eslint-disable-next-line
- export const doZoom = (wrapper, chart = chart) => {
- wrapper.find('ChartZoom').instance().handleDataZoom({}, chart);
- wrapper.find('ChartZoom').instance().handleChartFinished({}, chart);
- };
- export const mockZoomRange = (startValue, endValue) => {
- chart.getModel.mockImplementation(() => ({
- ...model,
- _payload: {
- batch: [
- {
- startValue,
- endValue,
- },
- ],
- },
- }));
- };
|