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', () => ({ 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();

View File

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