stackdriver: fix failing test

This commit is contained in:
Erik Sundell 2018-11-19 16:19:56 +01:00
parent 0ec4491a52
commit 164e9a4f9a
2 changed files with 12 additions and 24 deletions

View File

@ -6,6 +6,7 @@ import { MetricFindQueryTypes } from '../types';
jest.mock('../functions', () => ({
getMetricTypes: () => ({ metricTypes: [], selectedMetricType: '' }),
extractServicesFromMetricDescriptors: () => [],
}));
const props: VariableQueryProps = {
@ -26,7 +27,7 @@ describe('VariableQueryEditor', () => {
describe('and a new variable is created', () => {
it('should trigger a query using the first query type in the array', done => {
props.onChange = (query, definition) => {
expect(definition).toBe('Stackdriver - Metric Types');
expect(definition).toBe('Stackdriver - Services');
done();
};
renderer.create(<StackdriverVariableQueryEditor {...props} />).toJSON();

View File

@ -6,19 +6,24 @@ Array [
className="gf-form max-width-21"
>
<span
className="gf-form-label width-10"
className="gf-form-label width-10 query-keyword"
>
Query Types
Query Type
</span>
<div
className="gf-form-select-wrapper max-width-10"
className="gf-form-select-wrapper max-width-12"
>
<select
className="gf-form-input"
onChange={[Function]}
required={true}
value="metricTypes"
value="services"
>
<option
value="services"
>
Services
</option>
<option
value="metricTypes"
>
@ -57,24 +62,6 @@ Array [
</select>
</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>,
"",
]
`;