began work on built in template variables, #7190

This commit is contained in:
Torkel Ödegaard
2017-01-09 15:31:19 +01:00
parent e57c764410
commit e218837380
6 changed files with 30 additions and 23 deletions

View File

@@ -239,4 +239,16 @@ describe('templateSrv', function() {
expect(target).to.be('Server: All, period: 13m');
});
});
describe('built in interval variables', function() {
beforeEach(function() {
initTemplateSrv([]);
});
it('should replace $interval_ms with interval milliseconds', function() {
var target = _templateSrv.replace('10 * $interval_ms', {"interval_ms": {text: "100", value: "100"}});
expect(target).to.be('10 * 100');
});
});
});