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
47bec0fd
Commit
47bec0fd
authored
Jul 23, 2018
by
Tobias Skarhed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix requested changes
parent
529883b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
public/app/plugins/panel/graph/specs/graph_ctrl.jest.ts
+10
-13
No files found.
public/app/plugins/panel/graph/specs/graph_ctrl.jest.ts
View file @
47bec0fd
...
@@ -3,7 +3,7 @@ import { GraphCtrl } from '../module';
...
@@ -3,7 +3,7 @@ import { GraphCtrl } from '../module';
jest
.
mock
(
'../graph'
,
()
=>
({}));
jest
.
mock
(
'../graph'
,
()
=>
({}));
describe
(
'GraphCtrl'
,
function
()
{
describe
(
'GraphCtrl'
,
()
=>
{
let
injector
=
{
let
injector
=
{
get
:
()
=>
{
get
:
()
=>
{
return
{
return
{
...
@@ -34,15 +34,12 @@ describe('GraphCtrl', function() {
...
@@ -34,15 +34,12 @@ describe('GraphCtrl', function() {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
ctx
.
ctrl
=
new
GraphCtrl
(
scope
,
injector
,
{});
ctx
.
ctrl
=
new
GraphCtrl
(
scope
,
injector
,
{});
});
beforeEach
(()
=>
{
ctx
.
ctrl
.
annotationsPromise
=
Promise
.
resolve
({});
ctx
.
ctrl
.
annotationsPromise
=
Promise
.
resolve
({});
ctx
.
ctrl
.
updateTimeRange
();
ctx
.
ctrl
.
updateTimeRange
();
});
});
describe
(
'when time series are outside range'
,
function
()
{
describe
(
'when time series are outside range'
,
()
=>
{
beforeEach
(
function
()
{
beforeEach
(
()
=>
{
var
data
=
[
var
data
=
[
{
{
target
:
'test.cpu1'
,
target
:
'test.cpu1'
,
...
@@ -54,13 +51,13 @@ describe('GraphCtrl', function() {
...
@@ -54,13 +51,13 @@ describe('GraphCtrl', function() {
ctx
.
ctrl
.
onDataReceived
(
data
);
ctx
.
ctrl
.
onDataReceived
(
data
);
});
});
it
(
'should set datapointsOutside'
,
function
()
{
it
(
'should set datapointsOutside'
,
()
=>
{
expect
(
ctx
.
ctrl
.
dataWarning
.
title
).
toBe
(
'Data points outside time range'
);
expect
(
ctx
.
ctrl
.
dataWarning
.
title
).
toBe
(
'Data points outside time range'
);
});
});
});
});
describe
(
'when time series are inside range'
,
function
()
{
describe
(
'when time series are inside range'
,
()
=>
{
beforeEach
(
function
()
{
beforeEach
(
()
=>
{
var
range
=
{
var
range
=
{
from
:
moment
()
from
:
moment
()
.
subtract
(
1
,
'days'
)
.
subtract
(
1
,
'days'
)
...
@@ -79,18 +76,18 @@ describe('GraphCtrl', function() {
...
@@ -79,18 +76,18 @@ describe('GraphCtrl', function() {
ctx
.
ctrl
.
onDataReceived
(
data
);
ctx
.
ctrl
.
onDataReceived
(
data
);
});
});
it
(
'should set datapointsOutside'
,
function
()
{
it
(
'should set datapointsOutside'
,
()
=>
{
expect
(
ctx
.
ctrl
.
dataWarning
).
toBe
(
null
);
expect
(
ctx
.
ctrl
.
dataWarning
).
toBe
(
null
);
});
});
});
});
describe
(
'datapointsCount given 2 series'
,
function
()
{
describe
(
'datapointsCount given 2 series'
,
()
=>
{
beforeEach
(
function
()
{
beforeEach
(
()
=>
{
var
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[]
},
{
target
:
'test.cpu2'
,
datapoints
:
[]
}];
var
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[]
},
{
target
:
'test.cpu2'
,
datapoints
:
[]
}];
ctx
.
ctrl
.
onDataReceived
(
data
);
ctx
.
ctrl
.
onDataReceived
(
data
);
});
});
it
(
'should set datapointsCount warning'
,
function
()
{
it
(
'should set datapointsCount warning'
,
()
=>
{
expect
(
ctx
.
ctrl
.
dataWarning
.
title
).
toBe
(
'No data points'
);
expect
(
ctx
.
ctrl
.
dataWarning
.
title
).
toBe
(
'No data points'
);
});
});
});
});
...
...
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