|
@@ -109,7 +109,6 @@ define([
|
|
|
describe('when checking if a string contains a variable', function() {
|
|
describe('when checking if a string contains a variable', function() {
|
|
|
beforeEach(function() {
|
|
beforeEach(function() {
|
|
|
_templateSrv.init([{ name: 'test', current: { value: 'muuuu' } }]);
|
|
_templateSrv.init([{ name: 'test', current: { value: 'muuuu' } }]);
|
|
|
- _templateSrv.updateTemplateData();
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('should find it with $var syntax', function() {
|
|
it('should find it with $var syntax', function() {
|
|
@@ -127,7 +126,6 @@ define([
|
|
|
describe('updateTemplateData with simple value', function() {
|
|
describe('updateTemplateData with simple value', function() {
|
|
|
beforeEach(function() {
|
|
beforeEach(function() {
|
|
|
_templateSrv.init([{ name: 'test', current: { value: 'muuuu' } }]);
|
|
_templateSrv.init([{ name: 'test', current: { value: 'muuuu' } }]);
|
|
|
- _templateSrv.updateTemplateData();
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('should set current value and update template data', function() {
|
|
it('should set current value and update template data', function() {
|
|
@@ -136,6 +134,30 @@ define([
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ describe('fillVariableValuesForUrl with multi value', function() {
|
|
|
|
|
+ beforeEach(function() {
|
|
|
|
|
+ _templateSrv.init([{ name: 'test', current: { value: ['val1', 'val2'] }}]);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ it('should set multiple url params', function() {
|
|
|
|
|
+ var params = {};
|
|
|
|
|
+ _templateSrv.fillVariableValuesForUrl(params);
|
|
|
|
|
+ expect(params['var-test']).to.eql(['val1', 'val2']);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ describe('fillVariableValuesForUrl with multi value and scopedVars', function() {
|
|
|
|
|
+ beforeEach(function() {
|
|
|
|
|
+ _templateSrv.init([{ name: 'test', current: { value: ['val1', 'val2'] }}]);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ it('should set multiple url params', function() {
|
|
|
|
|
+ var params = {};
|
|
|
|
|
+ _templateSrv.fillVariableValuesForUrl(params, {'test': {value: 'val1'}});
|
|
|
|
|
+ expect(params['var-test']).to.eql('val1');
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
describe('replaceWithText', function() {
|
|
describe('replaceWithText', function() {
|
|
|
beforeEach(function() {
|
|
beforeEach(function() {
|
|
|
_templateSrv.init([
|
|
_templateSrv.init([
|