Просмотр исходного кода

test if default variable interpolation is effective when no specific
format is specified

Sven Klemm 7 лет назад
Родитель
Сommit
a806f542c6
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      public/app/features/templating/specs/template_srv.jest.ts

+ 10 - 0
public/app/features/templating/specs/template_srv.jest.ts

@@ -136,6 +136,11 @@ describe('templateSrv', function() {
       var target = _templateSrv.replace('this=${test:pipe}', {});
       expect(target).toBe('this=value1|value2');
     });
+
+    it('should replace ${test:pipe} with piped value and $test with globbed value', function() {
+      var target = _templateSrv.replace('${test:pipe},$test', {}, 'glob');
+      expect(target).toBe('value1|value2,{value1,value2}');
+    });
   });
 
   describe('variable with all option', function() {
@@ -164,6 +169,11 @@ describe('templateSrv', function() {
       var target = _templateSrv.replace('this.${test:glob}.filters', {});
       expect(target).toBe('this.{value1,value2}.filters');
     });
+
+    it('should replace ${test:pipe} with piped value and $test with globbed value', function() {
+      var target = _templateSrv.replace('${test:pipe},$test', {}, 'glob');
+      expect(target).toBe('value1|value2,{value1,value2}');
+    });
   });
 
   describe('variable with all option and custom value', function() {