grafana/public/app/features/explore/ErrorContainer.test.tsx
kay delaney 783391a861
CloudWatch Logs: Adjusts CloudWatch Logs timeout logic (#26621)
* CloudWatch Logs: Adjusts CloudWatch Logs timeout logic

Previously CloudWatch Logs queries would time out if,
after a number of attempts, a response was received with no additional data.
This commit changes the behavior so that a consecutive number of requests
yielding no additional data must be made before we cancel the query
2020-09-07 14:41:36 +01:00

36 lines
891 B
TypeScript

import React from 'react';
import { DataQueryError } from '@grafana/data';
import { shallow } from 'enzyme';
import { ErrorContainer } from './ErrorContainer';
const makeError = (propOverrides?: DataQueryError): DataQueryError => {
const queryError: DataQueryError = {
data: {
message: 'Error data message',
error: 'Error data content',
},
message: 'Error message',
status: 'Error status',
statusText: 'Error status text',
refId: 'A',
};
Object.assign(queryError, propOverrides);
return queryError;
};
const setup = (propOverrides?: object) => {
const props = {
queryError: makeError(propOverrides),
};
const wrapper = shallow(<ErrorContainer {...props} />);
return wrapper;
};
describe('ErrorContainer', () => {
it('should render component', () => {
const wrapper = setup();
expect(wrapper).toMatchSnapshot();
});
});