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
50b09f4f
Commit
50b09f4f
authored
Jun 08, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:grafana/grafana
parents
2c75593c
f7c48c5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
public/app/plugins/panel/singlestat/module.ts
+1
-1
public/app/plugins/panel/singlestat/specs/singlestat_specs.ts
+14
-2
No files found.
public/app/plugins/panel/singlestat/module.ts
View file @
50b09f4f
...
...
@@ -165,7 +165,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
return
;
}
if
(
tableData
[
0
].
length
===
0
||
!
tableData
[
0
][
0
][
this
.
panel
.
tableColumn
]
)
{
if
(
tableData
[
0
].
length
===
0
||
tableData
[
0
][
0
][
this
.
panel
.
tableColumn
]
===
undefined
)
{
return
;
}
...
...
public/app/plugins/panel/singlestat/specs/singlestat_specs.ts
View file @
50b09f4f
...
...
@@ -65,7 +65,7 @@ describe('SingleStatCtrl', function() {
expect
(
ctx
.
data
.
valueRounded
).
to
.
be
(
0
);
});
it
(
'should set formatted
f
alue'
,
function
()
{
it
(
'should set formatted
v
alue'
,
function
()
{
expect
(
ctx
.
data
.
valueFormatted
).
to
.
be
(
'test.cpu1'
);
});
});
...
...
@@ -82,7 +82,7 @@ describe('SingleStatCtrl', function() {
expect
(
ctx
.
data
.
valueRounded
).
to
.
be
(
100
);
});
it
(
'should set formatted
f
alue'
,
function
()
{
it
(
'should set formatted
v
alue'
,
function
()
{
expect
(
ctx
.
data
.
valueFormatted
).
to
.
be
(
'100'
);
});
});
...
...
@@ -254,6 +254,18 @@ describe('SingleStatCtrl', function() {
expect
(
ctx
.
data
.
valueFormatted
).
to
.
be
(
'ignore1'
);
});
});
singleStatScenario
(
'When value is zero'
,
function
(
ctx
)
{
ctx
.
setup
(
function
()
{
ctx
.
data
=
tableData
;
ctx
.
data
[
0
].
rows
[
0
]
=
[
1492759673649
,
'ignore1'
,
0
,
'ignore2'
];
ctx
.
ctrl
.
panel
.
tableColumn
=
'mean'
;
});
it
(
'Should return zero'
,
function
()
{
expect
(
ctx
.
data
.
value
).
to
.
be
(
0
);
});
});
});
});
...
...
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