mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
* 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
36 lines
891 B
TypeScript
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();
|
|
});
|
|
});
|