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
7e434fc0
Commit
7e434fc0
authored
Sep 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: moved graphite specs into plugins directory
parent
cb7424ce
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
44 deletions
+44
-44
karma.conf.js
+1
-0
public/app/plugins/datasource/graphite/add_graphite_func.js
+0
-0
public/app/plugins/datasource/graphite/datasource.js
+3
-3
public/app/plugins/datasource/graphite/func_editor.js
+0
-0
public/app/plugins/datasource/graphite/query_ctrl.js
+0
-0
public/app/plugins/datasource/graphite/specs/datasource_specs.ts
+7
-9
public/app/plugins/datasource/graphite/specs/gfunc_specs.ts
+13
-16
public/app/plugins/datasource/graphite/specs/query_ctrl_specs.ts
+13
-14
public/test/lib/common.ts
+6
-1
public/test/test-main.js
+1
-1
No files found.
karma.conf.js
View file @
7e434fc0
...
...
@@ -25,6 +25,7 @@ module.exports = function(config) {
browsers
:
[
'PhantomJS'
],
captureTimeout
:
60000
,
singleRun
:
true
,
autoWatchBatchDelay
:
1000
,
});
...
...
public/app/plugins/datasource/graphite/add
GraphiteF
unc.js
→
public/app/plugins/datasource/graphite/add
_graphite_f
unc.js
View file @
7e434fc0
File moved
public/app/plugins/datasource/graphite/datasource.js
View file @
7e434fc0
...
...
@@ -5,9 +5,9 @@ define([
'config'
,
'app/core/utils/datemath'
,
'./directives'
,
'./query
C
trl'
,
'./func
E
ditor'
,
'./add
GraphiteF
unc'
,
'./query
_c
trl'
,
'./func
_e
ditor'
,
'./add
_graphite_f
unc'
,
],
function
(
angular
,
_
,
$
,
config
,
dateMath
)
{
'use strict'
;
...
...
public/app/plugins/datasource/graphite/func
E
ditor.js
→
public/app/plugins/datasource/graphite/func
_e
ditor.js
View file @
7e434fc0
File moved
public/app/plugins/datasource/graphite/query
C
trl.js
→
public/app/plugins/datasource/graphite/query
_c
trl.js
View file @
7e434fc0
File moved
public/
test/specs/graphiteDatasource-specs.j
s
→
public/
app/plugins/datasource/graphite/specs/datasource_specs.t
s
View file @
7e434fc0
define
([
'./helpers'
,
'app/plugins/datasource/graphite/datasource'
],
function
(
helpers
)
{
'use strict'
;
///<amd-dependency path="app/plugins/datasource/graphite/datasource" />
///<amd-dependency path="test/specs/helpers" name="helpers" />
describe
(
'graphiteDatasource'
,
function
()
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
,
angularMocks
}
from
'test/lib/common'
;
declare
var
helpers
:
any
;
describe
(
'graphiteDatasource'
,
function
()
{
var
ctx
=
new
helpers
.
ServiceTestContext
();
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
angularMocks
.
module
(
'grafana.services'
));
beforeEach
(
ctx
.
providePhase
([
'backendSrv'
]));
beforeEach
(
ctx
.
createService
(
'GraphiteDatasource'
));
...
...
@@ -116,7 +116,5 @@ define([
});
});
});
public/
test/specs/gfunc-specs.j
s
→
public/
app/plugins/datasource/graphite/specs/gfunc_specs.t
s
View file @
7e434fc0
define
([
'app/plugins/datasource/graphite/gfunc'
],
function
(
gfunc
)
{
'use strict'
;
///<amd-dependency path="app/plugins/datasource/graphite/gfunc" name="gfunc" />
describe
(
'when creating func instance from func names'
,
function
()
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
}
from
'test/lib/common'
;
declare
var
gfunc
:
any
;
describe
(
'when creating func instance from func names'
,
function
()
{
it
(
'should return func instance'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'sumSeries'
);
expect
(
func
).
to
.
be
.
ok
();
...
...
@@ -31,10 +31,9 @@ define([
func
.
updateText
();
expect
(
func
.
text
).
to
.
equal
(
"groupByNode(5, avg)"
);
});
});
});
describe
(
'when rendering func instance'
,
function
()
{
describe
(
'when rendering func instance'
,
function
()
{
it
(
'should handle single metric param'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'sumSeries'
);
...
...
@@ -77,16 +76,16 @@ define([
expect
(
func
.
render
(
'#A'
)).
to
.
equal
(
"asPercent(#A, #B)"
);
});
});
});
describe
(
'when requesting function categories'
,
function
()
{
describe
(
'when requesting function categories'
,
function
()
{
it
(
'should return function categories'
,
function
()
{
var
catIndex
=
gfunc
.
getCategories
();
expect
(
catIndex
.
Special
.
length
).
to
.
be
.
greaterThan
(
8
);
});
});
});
describe
(
'when updating func param'
,
function
()
{
describe
(
'when updating func param'
,
function
()
{
it
(
'should update param value and update text representation'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'summarize'
,
{
withDefaultParams
:
true
});
func
.
updateParam
(
'1h'
,
0
);
...
...
@@ -99,9 +98,9 @@ define([
func
.
updateParam
(
'0.001'
,
0
);
expect
(
func
.
params
[
0
]).
to
.
be
(
'0.001'
);
});
});
});
describe
(
'when updating func param with optional second parameter'
,
function
()
{
describe
(
'when updating func param with optional second parameter'
,
function
()
{
it
(
'should update value and text'
,
function
()
{
var
func
=
gfunc
.
createFuncInstance
(
'aliasByNode'
);
func
.
updateParam
(
'1'
,
0
);
...
...
@@ -124,7 +123,5 @@ define([
expect
(
func
.
params
[
1
]).
to
.
be
(
undefined
);
expect
(
func
.
text
).
to
.
be
(
'aliasByNode(4)'
);
});
});
});
public/
test/specs/graphiteTargetCtrl-specs.j
s
→
public/
app/plugins/datasource/graphite/specs/query_ctrl_specs.t
s
View file @
7e434fc0
define
([
'./helpers'
,
'app/plugins/datasource/graphite/gfunc'
,
'app/plugins/datasource/graphite/queryCtrl'
,
'app/services/uiSegmentSrv'
],
function
(
helpers
,
gfunc
)
{
'use strict'
;
describe
(
'GraphiteQueryCtrl'
,
function
()
{
///<amd-dependency path="app/plugins/datasource/graphite/gfunc" name="gfunc"/>
///<amd-dependency path="app/plugins/datasource/graphite/query_ctrl" />
///<amd-dependency path="app/services/uiSegmentSrv" />
///<amd-dependency path="test/specs/helpers" name="helpers" />
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
,
angularMocks
}
from
'test/lib/common'
;
declare
var
gfunc
:
any
;
declare
var
helpers
:
any
;
describe
(
'GraphiteQueryCtrl'
,
function
()
{
var
ctx
=
new
helpers
.
ControllerTestContext
();
beforeEach
(
module
(
'grafana.controllers'
));
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
angularMocks
.
module
(
'grafana.controllers'
));
beforeEach
(
angularMocks
.
module
(
'grafana.services'
));
beforeEach
(
ctx
.
providePhase
());
beforeEach
(
ctx
.
createControllerPhase
(
'GraphiteQueryCtrl'
));
...
...
@@ -173,7 +175,4 @@ define([
expect
(
ctx
.
scope
.
$parent
.
get_data
.
called
).
to
.
be
(
true
);
});
});
});
});
public/test/lib/common.ts
View file @
7e434fc0
...
...
@@ -7,10 +7,15 @@ var it = _global.it;
var
sinon
=
_global
.
sinon
;
var
expect
=
_global
.
expect
;
var
angularMocks
=
{
module
:
_global
.
module
,
};
export
{
beforeEach
,
describe
,
it
,
sinon
,
expect
expect
,
angularMocks
,
}
public/test/test-main.js
View file @
7e434fc0
...
...
@@ -113,7 +113,7 @@ require([
var
specs
=
[];
for
(
var
file
in
window
.
__karma__
.
files
)
{
if
(
/
base
\/
test
\/
specs.*/
.
test
(
file
))
{
if
(
/specs.*/
.
test
(
file
))
{
file
=
file2moduleName
(
file
);
specs
.
push
(
file
);
}
...
...
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