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
bff7a293
Commit
bff7a293
authored
Jul 27, 2018
by
Tobias Skarhed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
3d21e42a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
26 deletions
+0
-26
public/app/plugins/panel/singlestat/specs/singlestat.jest.ts
+0
-26
No files found.
public/app/plugins/panel/singlestat/specs/singlestat.jest.ts
View file @
bff7a293
// import { describe, beforeEach, afterEach, it, sinon, expect, angularMocks } from 'test/lib/common';
// import helpers from 'test/specs/helpers';
import
{
SingleStatCtrl
}
from
'../module'
;
import
moment
from
'moment'
;
...
...
@@ -30,17 +27,6 @@ describe('SingleStatCtrl', function() {
function
singleStatScenario
(
desc
,
func
)
{
describe
(
desc
,
function
()
{
ctx
.
setup
=
function
(
setupFunc
)
{
// beforeEach(angularMocks.module('grafana.services'));
// beforeEach(angularMocks.module('grafana.controllers'));
// beforeEach(
// angularMocks.module(function($compileProvider) {
// $compileProvider.preAssignBindingsEnabled(true);
// })
// );
// beforeEach(ctx.providePhase());
// beforeEach(ctx.createPanelController(SingleStatCtrl));
beforeEach
(
function
()
{
ctx
.
ctrl
=
new
SingleStatCtrl
(
$scope
,
$injector
,
{});
setupFunc
();
...
...
@@ -107,7 +93,6 @@ describe('SingleStatCtrl', function() {
ctx
.
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[[
10
,
12
],
[
20
,
5000
]]
}];
ctx
.
ctrl
.
panel
.
valueName
=
'last_time'
;
ctx
.
ctrl
.
panel
.
format
=
'dateTimeAsIso'
;
// ctx.setIsUtc(true);
ctx
.
ctrl
.
dashboard
.
isTimezoneUtc
=
()
=>
true
;
});
...
...
@@ -139,7 +124,6 @@ describe('SingleStatCtrl', function() {
ctx
.
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[[
10
,
12
],
[
20
,
5000
]]
}];
ctx
.
ctrl
.
panel
.
valueName
=
'last_time'
;
ctx
.
ctrl
.
panel
.
format
=
'dateTimeAsUS'
;
// ctx.setIsUtc(true);
ctx
.
ctrl
.
dashboard
.
isTimezoneUtc
=
()
=>
true
;
});
...
...
@@ -149,11 +133,6 @@ describe('SingleStatCtrl', function() {
});
singleStatScenario
(
'showing last time from now instead of value'
,
function
(
ctx
)
{
beforeEach
(()
=>
{
// clock = sinon.useFakeTimers(epoch);
//jest.useFakeTimers();
});
ctx
.
setup
(
function
()
{
ctx
.
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[[
10
,
12
],
[
20
,
1505634997920
]]
}];
ctx
.
ctrl
.
panel
.
valueName
=
'last_time'
;
...
...
@@ -168,10 +147,6 @@ describe('SingleStatCtrl', function() {
it
(
'should set formatted value'
,
function
()
{
expect
(
ctx
.
data
.
valueFormatted
).
toBe
(
'2 days ago'
);
});
afterEach
(()
=>
{
// jest.clearAllTimers();
});
});
singleStatScenario
(
'showing last time from now instead of value (in UTC)'
,
function
(
ctx
)
{
...
...
@@ -179,7 +154,6 @@ describe('SingleStatCtrl', function() {
ctx
.
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[[
10
,
12
],
[
20
,
1505634997920
]]
}];
ctx
.
ctrl
.
panel
.
valueName
=
'last_time'
;
ctx
.
ctrl
.
panel
.
format
=
'dateTimeFromNow'
;
// ctx.setIsUtc(true);
});
it
(
'should set formatted value'
,
function
()
{
...
...
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