import React from 'react'; import { shallow } from 'enzyme'; import { LoadingState, TimeRange } from '@grafana/data'; import { PanelData } from '@grafana/ui'; import QueryStatus from './QueryStatus'; describe('', () => { it('should render with a latency', () => { const res: PanelData = { series: [], state: LoadingState.Done, timeRange: {} as TimeRange }; const wrapper = shallow(); 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(); expect(wrapper.getElement()).toBe(null); }); });