test if default variable interpolation is effective when no specific

format is specified
This commit is contained in:
Sven Klemm 2018-05-03 18:42:58 +02:00
parent 764fa15e24
commit a806f542c6

View File

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