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
155ff06c
Commit
155ff06c
authored
Jun 14, 2018
by
Tobias Skarhed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Karma to Jest: threshold_manager
parent
2465f533
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
public/app/plugins/panel/graph/specs/threshold_manager.jest.ts
+20
-22
No files found.
public/app/plugins/panel/graph/specs/threshold_manager
_specs
.ts
→
public/app/plugins/panel/graph/specs/threshold_manager
.jest
.ts
View file @
155ff06c
import
{
describe
,
it
,
expect
}
from
'../../../../../test/lib/common'
;
import
angular
from
'angular'
;
import
TimeSeries
from
'app/core/time_series2'
;
import
{
ThresholdManager
}
from
'../threshold_manager'
;
...
...
@@ -38,16 +36,16 @@ describe('ThresholdManager', function() {
it
(
'should add fill for threshold with fill: true'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
0
].
yaxis
.
from
).
to
.
b
e
(
300
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
.
b
e
(
Infinity
);
expect
(
markings
[
0
].
color
).
to
.
b
e
(
'rgba(234, 112, 112, 0.12)'
);
expect
(
markings
[
0
].
yaxis
.
from
).
to
B
e
(
300
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
B
e
(
Infinity
);
expect
(
markings
[
0
].
color
).
to
B
e
(
'rgba(234, 112, 112, 0.12)'
);
});
it
(
'should add line'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
1
].
yaxis
.
from
).
to
.
b
e
(
300
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
.
b
e
(
300
);
expect
(
markings
[
1
].
color
).
to
.
b
e
(
'rgba(237, 46, 24, 0.60)'
);
expect
(
markings
[
1
].
yaxis
.
from
).
to
B
e
(
300
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
B
e
(
300
);
expect
(
markings
[
1
].
color
).
to
B
e
(
'rgba(237, 46, 24, 0.60)'
);
});
});
...
...
@@ -59,14 +57,14 @@ describe('ThresholdManager', function() {
it
(
'should add fill for first thresholds to next threshold'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
0
].
yaxis
.
from
).
to
.
b
e
(
200
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
.
b
e
(
300
);
expect
(
markings
[
0
].
yaxis
.
from
).
to
B
e
(
200
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
B
e
(
300
);
});
it
(
'should add fill for last thresholds to infinity'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
1
].
yaxis
.
from
).
to
.
b
e
(
300
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
.
b
e
(
Infinity
);
expect
(
markings
[
1
].
yaxis
.
from
).
to
B
e
(
300
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
B
e
(
Infinity
);
});
});
...
...
@@ -78,14 +76,14 @@ describe('ThresholdManager', function() {
it
(
'should add fill for first thresholds to next threshold'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
0
].
yaxis
.
from
).
to
.
b
e
(
300
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
.
b
e
(
200
);
expect
(
markings
[
0
].
yaxis
.
from
).
to
B
e
(
300
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
B
e
(
200
);
});
it
(
'should add fill for last thresholds to itself'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
1
].
yaxis
.
from
).
to
.
b
e
(
200
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
.
b
e
(
200
);
expect
(
markings
[
1
].
yaxis
.
from
).
to
B
e
(
200
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
B
e
(
200
);
});
});
...
...
@@ -97,14 +95,14 @@ describe('ThresholdManager', function() {
it
(
'should add fill for first thresholds to next threshold'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
0
].
yaxis
.
from
).
to
.
b
e
(
300
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
.
b
e
(
Infinity
);
expect
(
markings
[
0
].
yaxis
.
from
).
to
B
e
(
300
);
expect
(
markings
[
0
].
yaxis
.
to
).
to
B
e
(
Infinity
);
});
it
(
'should add fill for last thresholds to itself'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
1
].
yaxis
.
from
).
to
.
b
e
(
200
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
.
b
e
(
-
Infinity
);
expect
(
markings
[
1
].
yaxis
.
from
).
to
B
e
(
200
);
expect
(
markings
[
1
].
yaxis
.
to
).
to
B
e
(
-
Infinity
);
});
});
...
...
@@ -130,12 +128,12 @@ describe('ThresholdManager', function() {
it
(
'should add first threshold for left axis'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
0
].
yaxis
.
from
).
to
.
b
e
(
100
);
expect
(
markings
[
0
].
yaxis
.
from
).
to
B
e
(
100
);
});
it
(
'should add second threshold for right axis'
,
function
()
{
var
markings
=
ctx
.
options
.
grid
.
markings
;
expect
(
markings
[
1
].
y2axis
.
from
).
to
.
b
e
(
200
);
expect
(
markings
[
1
].
y2axis
.
from
).
to
B
e
(
200
);
});
});
});
...
...
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