Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c1cd1fed
Commit
c1cd1fed
authored
Apr 26, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added relevant tests
parent
5defc2a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
public/app/plugins/panel/singlestat/specs/singlestat-specs.ts
+25
-0
No files found.
public/app/plugins/panel/singlestat/specs/singlestat-specs.ts
View file @
c1cd1fed
...
...
@@ -84,4 +84,29 @@ describe('SingleStatCtrl', function() {
expect
(
ctx
.
data
.
valueFormated
).
to
.
be
(
'OK'
);
});
});
singleStatScenario
(
'When range to text mapping is specifiedfor first range'
,
function
(
ctx
)
{
ctx
.
setup
(
function
()
{
ctx
.
datapoints
=
[[
41
,
50
]];
ctx
.
ctrl
.
panel
.
mappingType
=
2
;
ctx
.
ctrl
.
panel
.
rangeMaps
=
[{
from
:
'10'
,
to
:
'50'
,
text
:
'OK'
},{
from
:
'51'
,
to
:
'100'
,
text
:
'NOT OK'
}];
});
it
(
'Should replace value with text OK'
,
function
()
{
expect
(
ctx
.
data
.
valueFormated
).
to
.
be
(
'OK'
);
});
});
singleStatScenario
(
'When range to text mapping is specified for other ranges'
,
function
(
ctx
)
{
ctx
.
setup
(
function
()
{
ctx
.
datapoints
=
[[
65
,
75
]];
ctx
.
ctrl
.
panel
.
mappingType
=
2
;
ctx
.
ctrl
.
panel
.
rangeMaps
=
[{
from
:
'10'
,
to
:
'50'
,
text
:
'OK'
},{
from
:
'51'
,
to
:
'100'
,
text
:
'NOT OK'
}];
});
it
(
'Should replace value with text NOT OK'
,
function
()
{
expect
(
ctx
.
data
.
valueFormated
).
to
.
be
(
'NOT OK'
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment