mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add test for unit menu structure.
This commit is contained in:
parent
85887ad1cf
commit
524f5d45ec
@ -4,6 +4,25 @@ define([
|
|||||||
], function(kbn, dateMath) {
|
], function(kbn, dateMath) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
describe('unit format menu', function() {
|
||||||
|
var menu = kbn.getUnitFormats();
|
||||||
|
menu.map(function(submenu) {
|
||||||
|
describe('submenu ' + submenu.text, function() {
|
||||||
|
it('should have a title', function() { expect(submenu.text).to.be.a('string'); });
|
||||||
|
it('should have a submenu', function() { expect(submenu.submenu).to.be.an('array'); });
|
||||||
|
submenu.submenu.map(function(entry) {
|
||||||
|
describe('entry ' + entry.text, function() {
|
||||||
|
it('should have a title', function() { expect(entry.text).to.be.a('string'); });
|
||||||
|
it('should have a format', function() { expect(entry.value).to.be.a('string'); });
|
||||||
|
it('should have a valid format', function() {
|
||||||
|
expect(kbn.valueFormats[entry.value]).to.be.a('function');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
function describeValueFormat(desc, value, tickSize, tickDecimals, result) {
|
function describeValueFormat(desc, value, tickSize, tickDecimals, result) {
|
||||||
|
|
||||||
describe('value format: ' + desc, function() {
|
describe('value format: ' + desc, function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user