mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
stackdriver: add simple render test
This commit is contained in:
parent
24cb44e029
commit
8333bf0b76
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import renderer from 'react-test-renderer';
|
||||||
|
import { StackdriverTemplateQueryComponent } from './TemplateQueryComponent';
|
||||||
|
import { TemplateQueryProps } from 'app/types/plugins';
|
||||||
|
|
||||||
|
describe('StackdriverTemplateQueryComponent', () => {
|
||||||
|
const props: TemplateQueryProps = {
|
||||||
|
onChange: (query, definition) => {},
|
||||||
|
query: '',
|
||||||
|
datasource: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
it('renders correctly', () => {
|
||||||
|
const tree = renderer.create(<StackdriverTemplateQueryComponent {...props} />).toJSON();
|
||||||
|
expect(tree).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,67 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`StackdriverTemplateQueryComponent renders correctly 1`] = `
|
||||||
|
Array [
|
||||||
|
<div
|
||||||
|
className="gf-form max-width-21"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="gf-form-label width-10"
|
||||||
|
>
|
||||||
|
Query Types
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
className="gf-form-select-wrapper max-width-10"
|
||||||
|
>
|
||||||
|
<select
|
||||||
|
className="gf-form-input"
|
||||||
|
onChange={[Function]}
|
||||||
|
required={true}
|
||||||
|
value="services"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
value="services"
|
||||||
|
>
|
||||||
|
Services
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
value="metricTypes"
|
||||||
|
>
|
||||||
|
Metric Types
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
value="metricLabels"
|
||||||
|
>
|
||||||
|
Metric Labels
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
value="resourceLabels"
|
||||||
|
>
|
||||||
|
Resource Labels
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
value="resourceTypes"
|
||||||
|
>
|
||||||
|
Resource Types
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
value="aggregations"
|
||||||
|
>
|
||||||
|
Aggregations
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
value="alignerns"
|
||||||
|
>
|
||||||
|
Aligners
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
value="alignmentPeriods"
|
||||||
|
>
|
||||||
|
Alignment Periods
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>,
|
||||||
|
"",
|
||||||
|
]
|
||||||
|
`;
|
Loading…
Reference in New Issue
Block a user