Erik Sundell 7 лет назад
Родитель
Сommit
164e9a4f9a

+ 2 - 1
public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.test.tsx

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

+ 10 - 23
public/app/plugins/datasource/stackdriver/components/__snapshots__/VariableQueryEditor.test.tsx.snap

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