|
@@ -2,12 +2,12 @@ import {describe, beforeEach, it, sinon, expect} from 'test/lib/common';
|
|
|
|
|
|
|
|
import {getColorForValue} from '../module';
|
|
import {getColorForValue} from '../module';
|
|
|
|
|
|
|
|
-describe('grafanaSingleStat', function() {
|
|
|
|
|
|
|
+describe.only('grafanaSingleStat', function() {
|
|
|
describe('legacy thresholds', () => {
|
|
describe('legacy thresholds', () => {
|
|
|
describe('positive thresholds', () => {
|
|
describe('positive thresholds', () => {
|
|
|
var data: any = {
|
|
var data: any = {
|
|
|
colorMap: ['green', 'yellow', 'red'],
|
|
colorMap: ['green', 'yellow', 'red'],
|
|
|
- thresholds: [0, 20, 50]
|
|
|
|
|
|
|
+ thresholds: [20, 50]
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
it('5 should return green', () => {
|
|
it('5 should return green', () => {
|
|
@@ -29,7 +29,7 @@ describe('grafanaSingleStat', function() {
|
|
|
describe('negative thresholds', () => {
|
|
describe('negative thresholds', () => {
|
|
|
var data: any = {
|
|
var data: any = {
|
|
|
colorMap: ['green', 'yellow', 'red'],
|
|
colorMap: ['green', 'yellow', 'red'],
|
|
|
- thresholds: [ -20, 0, 20]
|
|
|
|
|
|
|
+ thresholds: [ 0, 20]
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
it('-30 should return green', () => {
|
|
it('-30 should return green', () => {
|
|
@@ -48,7 +48,7 @@ describe('grafanaSingleStat', function() {
|
|
|
describe('negative thresholds', () => {
|
|
describe('negative thresholds', () => {
|
|
|
var data: any = {
|
|
var data: any = {
|
|
|
colorMap: ['green', 'yellow', 'red'],
|
|
colorMap: ['green', 'yellow', 'red'],
|
|
|
- thresholds: [ -40, -27, 20]
|
|
|
|
|
|
|
+ thresholds: [-27, 20]
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
it('-30 should return green', () => {
|
|
it('-30 should return green', () => {
|