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
6ed36e01
Commit
6ed36e01
authored
Dec 15, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(unit tests): moved kairosdb spec to it's plugin repo
parent
e28c9b33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
66 deletions
+0
-66
public/test/specs/kairosdb-datasource-specs.js
+0
-66
No files found.
public/test/specs/kairosdb-datasource-specs.js
deleted
100644 → 0
View file @
e28c9b33
define
([
'./helpers'
,
'app/plugins/datasource/kairosdb/datasource'
],
function
(
helpers
)
{
'use strict'
;
describe
(
'KairosDBDatasource'
,
function
()
{
var
ctx
=
new
helpers
.
ServiceTestContext
();
beforeEach
(
module
(
'grafana.core'
));
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
ctx
.
providePhase
([
'templateSrv'
]));
beforeEach
(
ctx
.
createService
(
'KairosDBDatasource'
));
beforeEach
(
function
()
{
ctx
.
ds
=
new
ctx
.
service
({
url
:
''
});
});
describe
(
'When querying kairosdb with one target using query editor target spec'
,
function
()
{
var
results
;
var
urlExpected
=
"/api/v1/datapoints/query"
;
var
bodyExpected
=
{
metrics
:
[{
name
:
"test"
}],
cache_time
:
0
,
start_relative
:
{
value
:
"1"
,
unit
:
"hours"
}
};
var
query
=
{
rangeRaw
:
{
from
:
'now-1h'
,
to
:
'now'
},
targets
:
[{
metric
:
'test'
,
downsampling
:
'(NONE)'
}]
};
var
response
=
{
queries
:
[{
sample_size
:
60
,
results
:
[{
name
:
"test"
,
values
:
[[
1420070400000
,
1
]]
}]
}]
};
beforeEach
(
function
()
{
ctx
.
$httpBackend
.
expect
(
'POST'
,
urlExpected
,
bodyExpected
).
respond
(
response
);
ctx
.
ds
.
query
(
query
).
then
(
function
(
data
)
{
results
=
data
;
});
ctx
.
$httpBackend
.
flush
();
});
it
(
'should generate the correct query'
,
function
()
{
ctx
.
$httpBackend
.
verifyNoOutstandingExpectation
();
});
it
(
'should return series list'
,
function
()
{
expect
(
results
.
data
.
length
).
to
.
be
(
1
);
expect
(
results
.
data
[
0
].
target
).
to
.
be
(
'test'
);
});
});
});
});
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