stackdriver: add simple render test

This commit is contained in:
Erik Sundell 2018-11-08 15:16:11 +01:00
parent 24cb44e029
commit 8333bf0b76
2 changed files with 84 additions and 0 deletions

View File

@ -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();
});
});

View File

@ -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>,
"",
]
`;