mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
stackdriver: fix failing test
This commit is contained in:
@@ -6,6 +6,7 @@ import { MetricFindQueryTypes } from '../types';
|
|||||||
|
|
||||||
jest.mock('../functions', () => ({
|
jest.mock('../functions', () => ({
|
||||||
getMetricTypes: () => ({ metricTypes: [], selectedMetricType: '' }),
|
getMetricTypes: () => ({ metricTypes: [], selectedMetricType: '' }),
|
||||||
|
extractServicesFromMetricDescriptors: () => [],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const props: VariableQueryProps = {
|
const props: VariableQueryProps = {
|
||||||
@@ -26,7 +27,7 @@ describe('VariableQueryEditor', () => {
|
|||||||
describe('and a new variable is created', () => {
|
describe('and a new variable is created', () => {
|
||||||
it('should trigger a query using the first query type in the array', done => {
|
it('should trigger a query using the first query type in the array', done => {
|
||||||
props.onChange = (query, definition) => {
|
props.onChange = (query, definition) => {
|
||||||
expect(definition).toBe('Stackdriver - Metric Types');
|
expect(definition).toBe('Stackdriver - Services');
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
renderer.create(<StackdriverVariableQueryEditor {...props} />).toJSON();
|
renderer.create(<StackdriverVariableQueryEditor {...props} />).toJSON();
|
||||||
|
|||||||
@@ -6,19 +6,24 @@ Array [
|
|||||||
className="gf-form max-width-21"
|
className="gf-form max-width-21"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="gf-form-label width-10"
|
className="gf-form-label width-10 query-keyword"
|
||||||
>
|
>
|
||||||
Query Types
|
Query Type
|
||||||
</span>
|
</span>
|
||||||
<div
|
<div
|
||||||
className="gf-form-select-wrapper max-width-10"
|
className="gf-form-select-wrapper max-width-12"
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
className="gf-form-input"
|
className="gf-form-input"
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
required={true}
|
required={true}
|
||||||
value="metricTypes"
|
value="services"
|
||||||
>
|
>
|
||||||
|
<option
|
||||||
|
value="services"
|
||||||
|
>
|
||||||
|
Services
|
||||||
|
</option>
|
||||||
<option
|
<option
|
||||||
value="metricTypes"
|
value="metricTypes"
|
||||||
>
|
>
|
||||||
@@ -57,24 +62,6 @@ 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