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
0ba75a88
Commit
0ba75a88
authored
Dec 11, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix threshold test
parent
5f7bc136
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
public/app/plugins/panel/gauge/Threshold.test.tsx
+16
-9
No files found.
public/app/plugins/panel/gauge/Threshold.test.tsx
View file @
0ba75a88
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
Thresholds
from
'./Thresholds'
;
import
{
OptionsProps
}
from
'./module'
;
import
{
defaultProps
,
OptionsProps
}
from
'./module'
;
import
{
PanelOptionsProps
}
from
'../../../types'
;
const
setup
=
(
propOverrides
?:
object
)
=>
{
const
props
:
PanelOptionsProps
<
OptionsProps
>
=
{
onChange
:
jest
.
fn
(),
options
:
{}
as
OptionsProps
,
options
:
{
...
defaultProps
.
options
,
thresholds
:
[
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
index
:
1
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
},
],
},
};
Object
.
assign
(
props
,
propOverrides
);
...
...
@@ -15,12 +21,6 @@ const setup = (propOverrides?: object) => {
return
shallow
(<
Thresholds
{
...
props
}
/>).
instance
()
as
Thresholds
;
};
const
thresholds
=
[
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
index
:
1
,
label
:
''
,
value
:
50
,
canRemove
:
true
,
color
:
'rgba(237, 129, 40, 0.89)'
},
{
index
:
2
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
},
];
describe
(
'Add threshold'
,
()
=>
{
it
(
'should add threshold between min and max'
,
()
=>
{
const
instance
=
setup
();
...
...
@@ -36,7 +36,14 @@ describe('Add threshold', () => {
it
(
'should add threshold between min and added threshold'
,
()
=>
{
const
instance
=
setup
({
options
:
{
thresholds
:
thresholds
},
options
:
{
...
defaultProps
.
options
,
thresholds
:
[
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
index
:
1
,
label
:
''
,
value
:
50
,
canRemove
:
true
,
color
:
'rgba(237, 129, 40, 0.89)'
},
{
index
:
2
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
},
],
},
});
instance
.
onAddThreshold
(
1
);
...
...
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