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
b250d103
Commit
b250d103
authored
Sep 30, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying to fox unit tests for sharePanelCtrl
parent
f63706d1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/test/specs/sharePanelCtrl-specs.js
+7
-2
No files found.
src/test/specs/sharePanelCtrl-specs.js
View file @
b250d103
define
([
'./helpers'
,
'moment'
,
'controllers/sharePanelCtrl'
],
function
(
helpers
)
{
],
function
(
helpers
,
moment
)
{
'use strict'
;
describe
(
'SharePanelCtrl'
,
function
()
{
...
...
@@ -12,6 +13,10 @@ define([
beforeEach
(
ctx
.
providePhase
());
beforeEach
(
ctx
.
createControllerPhase
(
'SharePanelCtrl'
));
function
getDate
(
year
,
month
,
day
)
{
return
moment
.
utc
(
new
Date
(
year
,
month
,
day
)).
toDate
();
}
describe
(
'shareUrl with current time range and panel'
,
function
()
{
it
(
'should generate share url relative time'
,
function
()
{
...
...
@@ -26,7 +31,7 @@ define([
it
(
'should generate share url absolute time'
,
function
()
{
ctx
.
$location
.
path
(
'/test'
);
ctx
.
scope
.
panel
=
{
id
:
22
};
ctx
.
timeSrv
.
time
=
{
from
:
new
Date
(
2012
,
1
,
1
),
to
:
new
Date
(
2014
,
3
,
5
)
};
ctx
.
timeSrv
.
time
=
{
from
:
get
Date
(
2012
,
1
,
1
),
to
:
new
Date
(
2014
,
3
,
5
)
};
ctx
.
scope
.
buildUrl
();
expect
(
ctx
.
scope
.
shareUrl
).
to
.
be
(
'http://server/#/test?from=1328050800000&to=1396648800000&panelId=22&fullscreen'
);
...
...
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