mirror of
https://github.com/grafana/grafana.git
synced 2025-01-28 17:24:59 -06:00
9b7748ec13
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data * Move types from grafana-ui to grafana-data * Move valueFormats to grafana-data * Move utils from grafana-ui to grafana-data * Update imports in grafana-ui * revert data's tsconfig change * Update imports in grafana-runtime * Fix import paths in grafana-ui * Move rxjs to devDeps * Core import updates batch 1 * Import updates batch 2 * Imports fix batch 3 * Imports fixes batch i don't know * Fix imorts in grafana-toolkit * Fix imports after master merge
20 lines
787 B
TypeScript
20 lines
787 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
|
|
import { LoadingState, TimeRange, PanelData } from '@grafana/data';
|
|
|
|
import QueryStatus from './QueryStatus';
|
|
|
|
describe('<QueryStatus />', () => {
|
|
it('should render with a latency', () => {
|
|
const res: PanelData = { series: [], state: LoadingState.Done, timeRange: {} as TimeRange };
|
|
const wrapper = shallow(<QueryStatus latency={0} queryResponse={res} />);
|
|
expect(wrapper.find('div').exists()).toBeTruthy();
|
|
});
|
|
it('should not render when query has not started', () => {
|
|
const res: PanelData = { series: [], state: LoadingState.NotStarted, timeRange: {} as TimeRange };
|
|
const wrapper = shallow(<QueryStatus latency={0} queryResponse={res} />);
|
|
expect(wrapper.getElement()).toBe(null);
|
|
});
|
|
});
|