mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
added unit tests for grid thresholds
This commit is contained in:
parent
c0d7ddf1fb
commit
c000f438ae
@ -73,6 +73,46 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
graphScenario('grid thresholds 100, 200', function(ctx) {
|
||||
ctx.setup(function(scope) {
|
||||
scope.panel.grid = {
|
||||
threshold1: 100,
|
||||
threshold1Color: "#111",
|
||||
threshold2: 200,
|
||||
threshold2Color: "#222",
|
||||
};
|
||||
});
|
||||
|
||||
it('should add grid markings', function() {
|
||||
var markings = ctx.plotOptions.grid.markings;
|
||||
expect(markings[0].yaxis.from).to.be(100);
|
||||
expect(markings[0].yaxis.to).to.be(200);
|
||||
expect(markings[0].color).to.be('#111');
|
||||
expect(markings[1].yaxis.from).to.be(200);
|
||||
expect(markings[1].yaxis.to).to.be(Infinity);
|
||||
});
|
||||
});
|
||||
|
||||
graphScenario('inverted grid thresholds 200, 100', function(ctx) {
|
||||
ctx.setup(function(scope) {
|
||||
scope.panel.grid = {
|
||||
threshold1: 200,
|
||||
threshold1Color: "#111",
|
||||
threshold2: 100,
|
||||
threshold2Color: "#222",
|
||||
};
|
||||
});
|
||||
|
||||
it('should add grid markings', function() {
|
||||
var markings = ctx.plotOptions.grid.markings;
|
||||
expect(markings[0].yaxis.from).to.be(200);
|
||||
expect(markings[0].yaxis.to).to.be(100);
|
||||
expect(markings[0].color).to.be('#111');
|
||||
expect(markings[1].yaxis.from).to.be(100);
|
||||
expect(markings[1].yaxis.to).to.be(-Infinity);
|
||||
});
|
||||
});
|
||||
|
||||
graphScenario('series option overrides, fill & points', function(ctx) {
|
||||
ctx.setup(function(scope, data) {
|
||||
scope.panel.lines = true;
|
||||
|
Loading…
Reference in New Issue
Block a user