stackdriver: fix failing tests
This commit is contained in:
+1
-2
@@ -5,7 +5,6 @@ import { TemplateQueryProps } from 'app/types/plugins';
|
|||||||
|
|
||||||
jest.mock('../functions', () => ({
|
jest.mock('../functions', () => ({
|
||||||
getMetricTypes: async () => ({ metricTypes: [], selectedMetricType: '' }),
|
getMetricTypes: async () => ({ metricTypes: [], selectedMetricType: '' }),
|
||||||
extractServicesFromMetricDescriptors: m => m,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const props: TemplateQueryProps = {
|
const props: TemplateQueryProps = {
|
||||||
@@ -24,7 +23,7 @@ describe('StackdriverTemplateQueryComponent', () => {
|
|||||||
|
|
||||||
it('should use the first query type in the array if no query type was saved before', done => {
|
it('should use the first query type in the array if no query type was saved before', done => {
|
||||||
props.onChange = (query, definition) => {
|
props.onChange = (query, definition) => {
|
||||||
expect(definition).toBe('Stackdriver - Services');
|
expect(definition).toBe('Stackdriver - Metric Types');
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
renderer.create(<StackdriverTemplateQueryComponent {...props} />).toJSON();
|
renderer.create(<StackdriverTemplateQueryComponent {...props} />).toJSON();
|
||||||
|
|||||||
+20
-7
@@ -17,13 +17,8 @@ Array [
|
|||||||
className="gf-form-input"
|
className="gf-form-input"
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
required={true}
|
required={true}
|
||||||
value="services"
|
value="metricTypes"
|
||||||
>
|
>
|
||||||
<option
|
|
||||||
value="services"
|
|
||||||
>
|
|
||||||
Services
|
|
||||||
</option>
|
|
||||||
<option
|
<option
|
||||||
value="metricTypes"
|
value="metricTypes"
|
||||||
>
|
>
|
||||||
@@ -62,6 +57,24 @@ Array [
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>,
|
</div>,
|
||||||
"",
|
<div
|
||||||
|
className="gf-form max-width-21"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="gf-form-label width-10"
|
||||||
|
>
|
||||||
|
Services
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
className="gf-form-select-wrapper max-width-10"
|
||||||
|
>
|
||||||
|
<select
|
||||||
|
className="gf-form-input"
|
||||||
|
onChange={[Function]}
|
||||||
|
required={true}
|
||||||
|
value=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>,
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user