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
d8cf4274
Commit
d8cf4274
authored
Mar 23, 2014
by
Torkel Ödegaard
Committed by
Bruce Sherrod
Mar 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more work on filterSrv unit tests
parent
517ac3f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
39 deletions
+8
-39
src/test/specs/filterSrv-specs.js
+1
-1
src/test/specs/graphiteTargetCtrl-specs.js
+1
-36
tasks/options/karma.js
+6
-2
No files found.
src/test/specs/filterSrv-specs.js
View file @
d8cf4274
...
...
@@ -28,7 +28,7 @@ define([
});
});
describe
.
only
(
'filterOptionSelected'
,
function
()
{
describe
(
'filterOptionSelected'
,
function
()
{
beforeEach
(
function
()
{
_filterSrv
.
add
({
name
:
'test'
});
_filterSrv
.
filterOptionSelected
(
_filterSrv
.
list
[
0
],
{
value
:
'muuuu'
});
...
...
src/test/specs/graphiteTargetCtrl-specs.js
View file @
d8cf4274
...
...
@@ -4,7 +4,7 @@ define([
'services/filterSrv'
],
function
(
dashboardMock
,
_
)
{
describe
(
'
filterSrv
'
,
function
()
{
describe
(
'
graphiteTargetCtrl
'
,
function
()
{
var
_filterSrv
;
beforeEach
(
module
(
'kibana.services'
));
...
...
@@ -21,40 +21,5 @@ define([
_filterSrv
.
add
({
name
:
'test'
,
current
:
{
value
:
'oogle'
}
});
_filterSrv
.
init
();
});
it
(
'should initialize template data'
,
function
()
{
var
target
=
_filterSrv
.
applyFilterToTarget
(
'this.[[test]].filters'
);
expect
(
target
).
to
.
be
(
'this.oogle.filters'
);
});
});
describe
.
only
(
'filterOptionSelected'
,
function
()
{
beforeEach
(
function
()
{
_filterSrv
.
add
({
name
:
'test'
});
_filterSrv
.
filterOptionSelected
(
_filterSrv
.
list
[
0
],
{
value
:
'muuuu'
});
});
it
(
'should set current value and update template data'
,
function
()
{
var
target
=
_filterSrv
.
applyFilterToTarget
(
'this.[[test]].filters'
);
expect
(
target
).
to
.
be
(
'this.muuuu.filters'
);
});
});
describe
(
'timeRange'
,
function
()
{
it
(
'should return unparsed when parse is false'
,
function
()
{
_filterSrv
.
setTime
({
from
:
'now'
,
to
:
'now-1h'
});
var
time
=
_filterSrv
.
timeRange
(
false
);
expect
(
time
.
from
).
to
.
be
(
'now'
);
expect
(
time
.
to
).
to
.
be
(
'now-1h'
);
});
it
(
'should return parsed when parse is true'
,
function
()
{
_filterSrv
.
setTime
({
from
:
'now'
,
to
:
'now-1h'
});
var
time
=
_filterSrv
.
timeRange
(
true
);
expect
(
_
.
isDate
(
time
.
from
)).
to
.
be
(
true
);
expect
(
_
.
isDate
(
time
.
to
)).
to
.
be
(
true
);
});
});
});
});
tasks/options/karma.js
View file @
d8cf4274
...
...
@@ -3,6 +3,11 @@ module.exports = function(config) {
dev
:
{
configFile
:
'src/test/karma.conf.js'
,
singleRun
:
false
,
browsers
:
[
'PhantomJS'
]
},
debug
:
{
configFile
:
'src/test/karma.conf.js'
,
singleRun
:
true
,
browsers
:
[
'Chrome'
]
},
test
:
{
...
...
@@ -11,4 +16,4 @@ module.exports = function(config) {
browsers
:
[
'PhantomJS'
]
}
};
};
\ No newline at end of file
};
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