瀏覽代碼

renames jest files to match new convention

bergquist 7 年之前
父節點
當前提交
6ba5550f5f
共有 1 個文件被更改,包括 20 次插入1 次删除
  1. 20 1
      public/app/plugins/datasource/grafana/specs/datasource.test.ts

+ 20 - 1
public/app/plugins/datasource/grafana/specs/datasource.jest.ts → public/app/plugins/datasource/grafana/specs/datasource.test.ts

@@ -13,7 +13,11 @@ describe('grafana data source', () => {
     };
 
     const templateSrvStub = {
-      replace: val => val.replace('$var', 'replaced')
+      replace: val => {
+        return val
+        .replace('$var2', 'replaced|replaced2')
+        .replace('$var', 'replaced');
+      }
     };
 
     const ds = new GrafanaDatasource(backendSrvStub, q, templateSrvStub);
@@ -32,6 +36,21 @@ describe('grafana data source', () => {
       });
     });
 
+    describe('with tags that have multi value template variables', () => {
+      const options = setupAnnotationQueryOptions(
+        {tags: ['$var2']}
+      );
+
+      beforeEach(() => {
+        return ds.annotationQuery(options);
+      });
+
+      it('should interpolate template variables in tags in query options', () => {
+        expect(calledBackendSrvParams.tags[0]).toBe('replaced');
+        expect(calledBackendSrvParams.tags[1]).toBe('replaced2');
+      });
+    });
+
     describe('with type dashboard', () => {
       const options = setupAnnotationQueryOptions(
         {