mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added unit tests for all and multi format options.
This commit is contained in:
parent
866f48f92d
commit
6f43cbf665
@ -81,6 +81,16 @@ define([
|
||||
expect(result).to.be('(test|test2)');
|
||||
});
|
||||
|
||||
it('multi value and pipe should render pipe string', function() {
|
||||
var result = _templateSrv.renderVariableValue({
|
||||
multiFormat: 'pipe',
|
||||
current: {
|
||||
value: ['test','test2'],
|
||||
}
|
||||
});
|
||||
expect(result).to.be('test|test2');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('can check if variable exists', function() {
|
||||
|
@ -349,6 +349,17 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
describeUpdateVariable('with include all pipe all values', function(scenario) {
|
||||
scenario.setup(function() {
|
||||
scenario.variable = { type: 'query', query: 'apps.*', name: 'test', includeAll: true, allFormat: 'pipe' };
|
||||
scenario.queryResult = [{text: 'backend1'}, {text: 'backend2'}, { text: 'backend3'}];
|
||||
});
|
||||
|
||||
it('should add pipe delimited string', function() {
|
||||
expect(scenario.variable.options[0].value).to.be('backend1|backend2|backend3');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user