mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(templating): lots of progress on template variable context specific formats, #2918, all elasticsearch / lucene use cases seem to work now
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"bitwise":false,
|
||||
"curly": true,
|
||||
"eqnull": true,
|
||||
"globalstrict": true,
|
||||
"strict": true,
|
||||
"devel": true,
|
||||
"eqeqeq": true,
|
||||
"forin": false,
|
||||
@@ -11,7 +11,7 @@
|
||||
"supernew": true,
|
||||
"expr": true,
|
||||
"indent": 2,
|
||||
"latedef": true,
|
||||
"latedef": false,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
|
||||
@@ -45,7 +45,7 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
describe.only('replace can pass multi / all format', function() {
|
||||
describe('replace can pass multi / all format', function() {
|
||||
beforeEach(function() {
|
||||
_templateSrv.init([{name: 'test', current: {value: ['value1', 'value2'] }}]);
|
||||
});
|
||||
@@ -59,6 +59,19 @@ define([
|
||||
var target = _templateSrv.replace('this=$test', {}, 'pipe');
|
||||
expect(target).to.be('this=value1|value2');
|
||||
});
|
||||
|
||||
it('should replace $test with piped value', function() {
|
||||
var target = _templateSrv.replace('this=$test', {}, 'pipe');
|
||||
expect(target).to.be('this=value1|value2');
|
||||
});
|
||||
});
|
||||
|
||||
describe.only('lucene format', function() {
|
||||
it('should properly escape $test with lucene escape sequences', function() {
|
||||
_templateSrv.init([{name: 'test', current: {value: 'value/4' }}]);
|
||||
var target = _templateSrv.replace('this:$test', {}, 'lucene');
|
||||
expect(target).to.be("this:value\\\/4");
|
||||
});
|
||||
});
|
||||
|
||||
describe('render variable to string values', function() {
|
||||
|
||||
Reference in New Issue
Block a user