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
b95d64e7
Commit
b95d64e7
authored
Oct 19, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fixed variable srv tests
parent
936fe560
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
public/app/features/templating/specs/variable_srv.test.ts
+5
-2
public/app/features/templating/specs/variable_srv_init.test.ts
+3
-2
public/app/features/templating/variable_srv.ts
+1
-1
No files found.
public/app/features/templating/specs/variable_srv.test.ts
View file @
b95d64e7
import
'../all'
;
import
{
VariableSrv
}
from
'../variable_srv'
;
import
{
DashboardModel
}
from
'../../dashboard/dashboard_model'
;
import
moment
from
'moment'
;
import
$q
from
'q'
;
...
...
@@ -56,10 +57,12 @@ describe('VariableSrv', function(this: any) {
return
getVarMockConstructor
(
ctr
,
model
,
ctx
);
};
ctx
.
variableSrv
.
init
({
ctx
.
variableSrv
.
init
(
new
DashboardModel
({
templating
:
{
list
:
[]
},
updateSubmenuVisibility
:
()
=>
{},
});
})
);
scenario
.
variable
=
ctx
.
variableSrv
.
createVariableFromModel
(
scenario
.
variableModel
);
ctx
.
variableSrv
.
addVariable
(
scenario
.
variable
);
...
...
public/app/features/templating/specs/variable_srv_init.test.ts
View file @
b95d64e7
...
...
@@ -2,6 +2,7 @@ import '../all';
import
_
from
'lodash'
;
import
{
VariableSrv
}
from
'../variable_srv'
;
import
{
DashboardModel
}
from
'../../dashboard/dashboard_model'
;
import
$q
from
'q'
;
describe
(
'VariableSrv init'
,
function
(
this
:
any
)
{
...
...
@@ -56,9 +57,9 @@ describe('VariableSrv init', function(this: any) {
ctx
.
variableSrv
.
datasourceSrv
=
ctx
.
datasourceSrv
;
ctx
.
variableSrv
.
$location
.
search
=
()
=>
scenario
.
urlParams
;
ctx
.
variableSrv
.
dashboard
=
{
ctx
.
variableSrv
.
dashboard
=
new
DashboardModel
(
{
templating
:
{
list
:
scenario
.
variables
},
};
}
)
;
await
ctx
.
variableSrv
.
init
(
ctx
.
variableSrv
.
dashboard
);
...
...
public/app/features/templating/variable_srv.ts
View file @
b95d64e7
...
...
@@ -18,7 +18,7 @@ export class VariableSrv {
init
(
dashboard
)
{
this
.
dashboard
=
dashboard
;
this
.
dashboard
.
on
(
'time-range-updated'
,
this
.
onTimeRangeUpdated
.
bind
(
this
));
this
.
dashboard
.
events
.
on
(
'time-range-updated'
,
this
.
onTimeRangeUpdated
.
bind
(
this
));
// create working class models representing variables
this
.
variables
=
dashboard
.
templating
.
list
=
dashboard
.
templating
.
list
.
map
(
this
.
createVariableFromModel
.
bind
(
this
));
...
...
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