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
73830a44
Commit
73830a44
authored
Feb 22, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sharemodal: fixes broken unittests
parent
fe223cbc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
public/test/specs/shareModalCtrl-specs.js
+15
-7
No files found.
public/test/specs/shareModalCtrl-specs.js
View file @
73830a44
...
@@ -2,7 +2,8 @@ define([
...
@@ -2,7 +2,8 @@ define([
'./helpers'
,
'./helpers'
,
'app/features/dashboard/shareModalCtrl'
,
'app/features/dashboard/shareModalCtrl'
,
'app/features/panellinks/linkSrv'
,
'app/features/panellinks/linkSrv'
,
],
function
(
helpers
)
{
'app/core/config'
,
],
function
(
helpers
,
shareModalCtrl
,
linkSrv
,
config
)
{
'use strict'
;
'use strict'
;
describe
(
'ShareModalCtrl'
,
function
()
{
describe
(
'ShareModalCtrl'
,
function
()
{
...
@@ -12,6 +13,14 @@ define([
...
@@ -12,6 +13,14 @@ define([
ctx
.
timeSrv
.
timeRange
=
sinon
.
stub
().
returns
(
range
);
ctx
.
timeSrv
.
timeRange
=
sinon
.
stub
().
returns
(
range
);
}
}
beforeEach
(
function
()
{
config
.
bootData
=
{
user
:
{
orgId
:
1
}
};
});
setTime
({
from
:
new
Date
(
1000
),
to
:
new
Date
(
2000
)
});
setTime
({
from
:
new
Date
(
1000
),
to
:
new
Date
(
2000
)
});
beforeEach
(
module
(
'grafana.controllers'
));
beforeEach
(
module
(
'grafana.controllers'
));
...
@@ -25,13 +34,12 @@ define([
...
@@ -25,13 +34,12 @@ define([
beforeEach
(
ctx
.
createControllerPhase
(
'ShareModalCtrl'
));
beforeEach
(
ctx
.
createControllerPhase
(
'ShareModalCtrl'
));
describe
(
'shareUrl with current time range and panel'
,
function
()
{
describe
(
'shareUrl with current time range and panel'
,
function
()
{
it
(
'should generate share url absolute time'
,
function
()
{
it
(
'should generate share url absolute time'
,
function
()
{
ctx
.
$location
.
path
(
'/test'
);
ctx
.
$location
.
path
(
'/test'
);
ctx
.
scope
.
panel
=
{
id
:
22
};
ctx
.
scope
.
panel
=
{
id
:
22
};
ctx
.
scope
.
init
();
ctx
.
scope
.
init
();
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000&panelId=22&fullscreen'
);
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000&
orgId=1&
panelId=22&fullscreen'
);
});
});
it
(
'should generate render url'
,
function
()
{
it
(
'should generate render url'
,
function
()
{
...
@@ -41,7 +49,7 @@ define([
...
@@ -41,7 +49,7 @@ define([
ctx
.
scope
.
init
();
ctx
.
scope
.
init
();
var
base
=
'http://dashboards.grafana.com/render/dashboard-solo/db/my-dash'
;
var
base
=
'http://dashboards.grafana.com/render/dashboard-solo/db/my-dash'
;
var
params
=
'?from=1000&to=2000&panelId=22&width=1000&height=500&tz=UTC'
;
var
params
=
'?from=1000&to=2000&
orgId=1&
panelId=22&width=1000&height=500&tz=UTC'
;
expect
(
ctx
.
scope
.
imageUrl
).
to
.
contain
(
base
+
params
);
expect
(
ctx
.
scope
.
imageUrl
).
to
.
contain
(
base
+
params
);
});
});
...
@@ -51,7 +59,7 @@ define([
...
@@ -51,7 +59,7 @@ define([
ctx
.
scope
.
panel
=
null
;
ctx
.
scope
.
panel
=
null
;
ctx
.
scope
.
init
();
ctx
.
scope
.
init
();
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000'
);
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000
&orgId=1
'
);
});
});
it
(
'should add theme when specified'
,
function
()
{
it
(
'should add theme when specified'
,
function
()
{
...
@@ -60,7 +68,7 @@ define([
...
@@ -60,7 +68,7 @@ define([
ctx
.
scope
.
panel
=
null
;
ctx
.
scope
.
panel
=
null
;
ctx
.
scope
.
init
();
ctx
.
scope
.
init
();
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000&theme=light'
);
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000&
orgId=1&
theme=light'
);
});
});
it
(
'should include template variables in url'
,
function
()
{
it
(
'should include template variables in url'
,
function
()
{
...
@@ -73,7 +81,7 @@ define([
...
@@ -73,7 +81,7 @@ define([
};
};
ctx
.
scope
.
buildUrl
();
ctx
.
scope
.
buildUrl
();
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000&var-app=mupp&var-server=srv-01'
);
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#!/test?from=1000&to=2000&
orgId=1&
var-app=mupp&var-server=srv-01'
);
});
});
});
});
...
...
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