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
993a2dac
Commit
993a2dac
authored
Apr 10, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed failing unit test, added 2 more for setTime & auto refresh behavior
parent
541baac4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
src/test/mocks/dashboard-mock.js
+2
-1
src/test/specs/filterSrv-specs.js
+20
-1
No files found.
src/test/mocks/dashboard-mock.js
View file @
993a2dac
...
...
@@ -6,6 +6,7 @@ define([],
create
:
function
()
{
return
{
refresh
:
function
()
{},
set_interval
:
function
(
value
)
{
this
.
current
.
refresh
=
value
;
},
current
:
{
title
:
""
,
...
...
@@ -33,7 +34,7 @@ define([],
load_local
:
false
,
hide
:
false
},
refresh
:
fals
e
refresh
:
tru
e
}
};
}
...
...
src/test/specs/filterSrv-specs.js
View file @
993a2dac
...
...
@@ -7,10 +7,12 @@ define([
describe
(
'filterSrv'
,
function
()
{
var
_filterSrv
;
var
_dashboard
;
beforeEach
(
module
(
'kibana.services'
));
beforeEach
(
module
(
function
(
$provide
){
$provide
.
value
(
'dashboard'
,
dashboardMock
.
create
());
_dashboard
=
dashboardMock
.
create
();
$provide
.
value
(
'dashboard'
,
_dashboard
);
}));
beforeEach
(
inject
(
function
(
filterSrv
)
{
...
...
@@ -56,6 +58,23 @@ define([
});
});
describe
(
'setTime'
,
function
()
{
it
(
'should return disable refresh for absolute times'
,
function
()
{
_dashboard
.
current
.
refresh
=
true
;
_filterSrv
.
setTime
({
from
:
'2011-01-01'
,
to
:
'2015-01-01'
});
expect
(
_dashboard
.
current
.
refresh
).
to
.
be
(
false
);
});
it
(
'should restore refresh after relative time range is set'
,
function
()
{
_dashboard
.
current
.
refresh
=
true
;
_filterSrv
.
setTime
({
from
:
'2011-01-01'
,
to
:
'2015-01-01'
});
expect
(
_dashboard
.
current
.
refresh
).
to
.
be
(
false
);
_filterSrv
.
setTime
({
from
:
'2011-01-01'
,
to
:
'now'
});
expect
(
_dashboard
.
current
.
refresh
).
to
.
be
(
true
);
});
});
});
});
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